summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-03 02:12:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-03 02:12:32 +0900
commitc94de44f2726ba59cfb5d02751abdda5d0b9dca1 (patch)
tree072eb305257e51df87745b13bee0e90779b3f396
parentwip (diff)
downloadsharkey-c94de44f2726ba59cfb5d02751abdda5d0b9dca1.tar.gz
sharkey-c94de44f2726ba59cfb5d02751abdda5d0b9dca1.tar.bz2
sharkey-c94de44f2726ba59cfb5d02751abdda5d0b9dca1.zip
Fix bug
-rw-r--r--src/api/endpoints/posts/create.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts
index 5ce852280a..686c3a67d0 100644
--- a/src/api/endpoints/posts/create.ts
+++ b/src/api/endpoints/posts/create.ts
@@ -139,12 +139,12 @@ module.exports = (params, user, app) =>
if (choice.trim().length > 50) return true;
return false;
});
- return shouldReject ? 'invalid poll choices' : true;
+ return shouldReject ? new Error('invalid poll choices') : true;
},
// 選択肢がひとつならエラー
- choices => choices.length == 1 ? 'poll choices must be ひとつ以上' : true,
+ choices => choices.length == 1 ? new Error('poll choices must be ひとつ以上') : true,
// 選択肢が多すぎてもエラー
- choices => choices.length > 10 ? 'many poll choices' : true,
+ choices => choices.length > 10 ? new Error('many poll choices') : true,
]);
if (pollChoicesErr) return rej('invalid poll choices');