transforming response and getting the right object back for the line

This commit is contained in:
talksik
2022-05-05 08:56:40 -05:00
parent d013212054
commit 7f5eba7732
7 changed files with 116 additions and 38 deletions
+14 -13
View File
@@ -1,22 +1,23 @@
import AudioClip from "./audioClip.model";
import { LineMember } from "./line.model";
import { ObjectId } from "mongodb";
import { Line, LineMember } from "./line.model";
import AudioClip from "./audioClip.model";
import { ObjectId } from "mongodb";
import { User } from "./user.model";
// why do we have separate full objects being sent?
// speed...I'm developing full stack and I just want all of the data and don't want to change this model
// repeatedly and trace data back and forth
export default class MasterLineData {
constructor(
// attributes of conversation
public id: ObjectId, // id of the conversation
// full line object
public lineDetails: Line,
public createdDate: Date,
public lastUpdatedDate: Date,
// compiled data for easy client read
public currentUserMember?: LineMember,
// requesting user's association to the line
public currentUserMember: LineMember,
// all other members in the convo as well as their user object to see the member details
public otherMembers?: LineMember[],
public audioClips: AudioClip[] = [],
public name?: string
public otherUserObjects?: User[] /**public audioClips: AudioClip[] = [], // public media: Media[] */
) {}
}