This commit is contained in:
Peter Maquiran
2023-01-12 15:27:09 +01:00
parent 58f9e7eacd
commit 9493179efd
82 changed files with 702 additions and 557 deletions
+11 -6
View File
@@ -504,20 +504,25 @@ export class MessageService {
const message = this.getChatObj()
let a
if(!message.id) {
delete message.id
}
if (this.localReference) {
a = await MessageModel.get({localReference: this.localReference})
} else if (this._id) {
a = await MessageModel.get({id: this.id})
} else if(this.id) {
a = await MessageModel.get({_id: this._id})
} else if(this.id) {
a = await MessageModel.get({id: this.id})
}
for( const [name, value] of Object.entries(message)) {
a[name] = value
if(a) {
for( const [name, value] of Object.entries(message)) {
a[name] = value
}
await a.save()
}
await a.save()
} else {
this.earlySave = true
console.log('save change to early')