up0dating tldr very simple without a whole modal
This commit is contained in:
@@ -19,6 +19,8 @@ export default class Conversation {
|
||||
createdDate: Timestamp = Timestamp.now();
|
||||
createdByUserId: string;
|
||||
|
||||
lastUpdatedBy?: string; // some sort of security data collection whenever updating convo
|
||||
|
||||
constructor(
|
||||
_createdByUserId: string,
|
||||
_name: string,
|
||||
|
||||
@@ -166,4 +166,20 @@ export default class ConversationService {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async updateTldr(convoId: string, newTldr: string, updateUserId: string) {
|
||||
// todo make sure that this user is allowed to update it
|
||||
const docRef = doc(this.db, Collections.conversations, convoId);
|
||||
await setDoc(
|
||||
docRef,
|
||||
{
|
||||
tldr: newTldr,
|
||||
lastActivityDate: serverTimestamp(),
|
||||
lastUpdatedBy: updateUserId,
|
||||
},
|
||||
{ merge: true }
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user