diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index 3c7932c34..9b8c53caf 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -100,8 +100,10 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = }).then(notes => { notes.forEach(note => { note._files[note._files.findIndex(f => f._id.equals(file._id))] = file; - Note.findOneAndUpdate({ _id: note._id }, { - _files: note._files + Note.update({ _id: note._id }, { + $set: { + _files: note._files + } }); }); });