create conversation should work with frontend objectIds
This commit is contained in:
@@ -9,25 +9,31 @@ export default class Conversation {
|
||||
* includes basic user info as well as their information
|
||||
* for this particular conversation
|
||||
*/
|
||||
public members: (ConversationMember & User)[],
|
||||
public members: ConversationUserMember[],
|
||||
|
||||
public name?: string,
|
||||
|
||||
public id: ObjectId = new ObjectId(),
|
||||
|
||||
/**
|
||||
* last time there was new content for everyone
|
||||
*/
|
||||
public lastActivityDate = new Date(),
|
||||
|
||||
/**
|
||||
* when name was changed or member list updated
|
||||
* when the conversation document was created
|
||||
*/
|
||||
public lastUpdatedDate = new Date(),
|
||||
public createdDate = new Date(),
|
||||
|
||||
public id: ObjectId = new ObjectId(),
|
||||
/**
|
||||
* when name was changed or member list updated
|
||||
*/
|
||||
public lastUpdatedDate?: Date,
|
||||
) {}
|
||||
}
|
||||
|
||||
export type ConversationUserMember = ConversationMember & User;
|
||||
|
||||
export class ConversationMember {
|
||||
constructor(
|
||||
public role: MemberRole,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Conversation from '@nirvana/core/models/conversation.model';
|
||||
import { ObjectId } from 'mongodb';
|
||||
|
||||
export default class CreateConversationRequest {
|
||||
constructor(public conversation: Conversation) {}
|
||||
constructor(public otherMemberIds: ObjectId[], public conversationName?: string) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user