diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-14 10:06:10 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-14 10:06:10 +0900 |
| commit | 3961fd08c9ade1bb034fe79894c81833cf4e0266 (patch) | |
| tree | 145147fcaba865f70d2ed7115afe77690cba3f5d /src/server/api/endpoints/drive/files/update.ts | |
| parent | 10.14.0 (diff) | |
| download | sharkey-3961fd08c9ade1bb034fe79894c81833cf4e0266.tar.gz sharkey-3961fd08c9ade1bb034fe79894c81833cf4e0266.tar.bz2 sharkey-3961fd08c9ade1bb034fe79894c81833cf4e0266.zip | |
Fix #2901
Diffstat (limited to 'src/server/api/endpoints/drive/files/update.ts')
| -rw-r--r-- | src/server/api/endpoints/drive/files/update.ts | 6 |
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 + } }); }); }); |