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/notes | |
| 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/notes')
| -rw-r--r-- | src/server/api/endpoints/notes/mentions.ts | 4 | ||||
| -rw-r--r-- | src/server/api/endpoints/notes/polls/vote.ts | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/server/api/endpoints/notes/mentions.ts b/src/server/api/endpoints/notes/mentions.ts index 718f5e4403..a353165cd0 100644 --- a/src/server/api/endpoints/notes/mentions.ts +++ b/src/server/api/endpoints/notes/mentions.ts @@ -91,5 +91,7 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { res(await packMany(mentions, user)); - mentions.forEach(note => read(user._id, note._id)); + for (const note of mentions) { + read(user._id, note._id); + } })); diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts index dc012152c6..8de0eb420e 100644 --- a/src/server/api/endpoints/notes/polls/vote.ts +++ b/src/server/api/endpoints/notes/polls/vote.ts @@ -102,12 +102,12 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { } }) .then(watchers => { - watchers.forEach(watcher => { + for (const watcher of watchers) { notify(watcher.userId, user._id, 'poll_vote', { noteId: note._id, choice: ps.choice }); - }); + } }); // この投稿をWatchする |