diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-11 20:36:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-11 20:36:55 +0900 |
| commit | 125849673a1aba46021852ee473d00f4520d1bd6 (patch) | |
| tree | e30d39490236df402b97a9963dafa44eaf549368 /src/server/api/endpoints/drive | |
| parent | Fix error (diff) | |
| download | sharkey-125849673a1aba46021852ee473d00f4520d1bd6.tar.gz sharkey-125849673a1aba46021852ee473d00f4520d1bd6.tar.bz2 sharkey-125849673a1aba46021852ee473d00f4520d1bd6.zip | |
Use for-of instead of forEach (#3583)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'src/server/api/endpoints/drive')
| -rw-r--r-- | src/server/api/endpoints/drive/files/update.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index a5835c6d65..7f9eb7bad3 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -100,14 +100,14 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { Note.find({ '_files._id': file._id }).then(notes => { - notes.forEach(note => { + for (const note of notes) { note._files[note._files.findIndex(f => f._id.equals(file._id))] = file; Note.update({ _id: note._id }, { $set: { _files: note._files } }); - }); + } }); // Serialize |