full flow of zapping or pinning and unpinning cold full run
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Conversation from '@nirvana/core/models/conversation.model';
|
||||
import Conversation, { MemberState } from '@nirvana/core/models/conversation.model';
|
||||
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { collections } from './database.service';
|
||||
|
||||
@@ -65,4 +66,16 @@ export default class ConversationService {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static async updateUserConversationPriority(
|
||||
conversationId: ObjectId,
|
||||
memberId: ObjectId,
|
||||
newState: MemberState,
|
||||
) {
|
||||
const query = { _id: conversationId, 'members._id': memberId };
|
||||
|
||||
return await collections.conversations?.findOneAndUpdate(query, {
|
||||
$set: { 'members.$.memberState': newState },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user