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 History from '../../models/messaging-history';
import serialize from '../../serializers/messaging-message';
@ -14,7 +14,7 @@ import serialize from '../../serializers/messaging-message';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit, limitErr] = it(params.limit).expect.number().range(1, 100).default(10).qed();
const [limit = 10, limitErr] = it(params.limit).expect.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get history