diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-05-24 20:50:17 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-05-24 20:50:17 +0900 |
| commit | caeba1197c4b66e10614ffbddce0a2e98b0b5ef3 (patch) | |
| tree | 929fbbcc92b9e24baa203fdb2e025f9e3e7e94f0 /src/api/endpoints/posts | |
| parent | Use tabs in json (diff) | |
| download | sharkey-caeba1197c4b66e10614ffbddce0a2e98b0b5ef3.tar.gz sharkey-caeba1197c4b66e10614ffbddce0a2e98b0b5ef3.tar.bz2 sharkey-caeba1197c4b66e10614ffbddce0a2e98b0b5ef3.zip | |
Refactoring
Diffstat (limited to 'src/api/endpoints/posts')
| -rw-r--r-- | src/api/endpoints/posts/create.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts index 26faee4713..535f850a6e 100644 --- a/src/api/endpoints/posts/create.ts +++ b/src/api/endpoints/posts/create.ts @@ -36,9 +36,7 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => { // Fetch files // forEach だと途中でエラーなどがあっても return できないので // 敢えて for を使っています。 - for (let i = 0; i < mediaIds.length; i++) { - const mediaId = mediaIds[i]; - + for (const mediaId of mediaIds) { // Fetch file // SELECT _id const entity = await DriveFile.findOne({ @@ -188,7 +186,7 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => { } }); - let mentions = []; + const mentions = []; function addMention(mentionee, type) { // Reject if already added |