summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-05-24 20:50:17 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-05-24 20:50:17 +0900
commitcaeba1197c4b66e10614ffbddce0a2e98b0b5ef3 (patch)
tree929fbbcc92b9e24baa203fdb2e025f9e3e7e94f0 /src/api/endpoints/posts
parentUse tabs in json (diff)
downloadsharkey-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.ts6
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