This commit is contained in:
syuilo
2017-03-05 12:00:39 +09:00
parent f210260826
commit 17a23c3eb5
67 changed files with 202 additions and 801 deletions

View File

@@ -1,7 +1,7 @@
/**
* Module dependencies
*/
import it from '../../../it';
import it from 'cafy';
import Vote from '../../../models/poll-vote';
import Post from '../../../models/post';
import notify from '../../../common/notify';
@@ -36,7 +36,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
it(params.choice).expect.string()
.required()
.validate(c => post.poll.choices.some(x => x.id == c))
.qed();
.get();
if (choiceError) return rej('invalid choice param');
// if already voted