This commit is contained in:
syuilo 2018-10-14 10:06:10 +09:00
parent e3faf64061
commit 3961fd08c9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -100,8 +100,10 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
}).then(notes => { }).then(notes => {
notes.forEach(note => { notes.forEach(note => {
note._files[note._files.findIndex(f => f._id.equals(file._id))] = file; note._files[note._files.findIndex(f => f._id.equals(file._id))] = file;
Note.findOneAndUpdate({ _id: note._id }, { Note.update({ _id: note._id }, {
_files: note._files $set: {
_files: note._files
}
}); });
}); });
}); });