summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/endpoints/drive/files/update.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts
index 3c7932c341..9b8c53caf7 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
+ }
});
});
});