summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorsyuilo⭐️ <Syuilotan@yahoo.co.jp>2017-02-24 13:27:17 +0900
committerGitHub <noreply@github.com>2017-02-24 13:27:17 +0900
commitce0cfbdf84f1f763095117a05d99cb454fd57533 (patch)
treee7c111c9ce68ec67b2f6b143917a504e7ab74650 /src/api
parentMerge pull request #202 from syuilo/greenkeeper/rimraf-2.6.1 (diff)
downloadsharkey-ce0cfbdf84f1f763095117a05d99cb454fd57533.tar.gz
sharkey-ce0cfbdf84f1f763095117a05d99cb454fd57533.tar.bz2
sharkey-ce0cfbdf84f1f763095117a05d99cb454fd57533.zip
[API] Fix bug
Diffstat (limited to 'src/api')
-rw-r--r--src/api/endpoints/posts/create.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/endpoints/posts/create.js b/src/api/endpoints/posts/create.js
index 73bd72cf6f..b0cdc8a970 100644
--- a/src/api/endpoints/posts/create.js
+++ b/src/api/endpoints/posts/create.js
@@ -243,7 +243,7 @@ module.exports = (params, user, app) =>
// 投稿を作成
const post = await Post.insert({
created_at: new Date(),
- media_ids: media ? files.map(file => file._id) : undefined,
+ media_ids: files.length > 0 ? files.map(file => file._id) : undefined,
reply_to_id: replyTo ? replyTo._id : undefined,
repost_id: repost ? repost._id : undefined,
poll: poll ? poll : undefined,