This commit is contained in:
syuilo 2017-03-09 03:50:09 +09:00
parent 3d536ddb3f
commit 31f36fa618
64 changed files with 241 additions and 256 deletions

View file

@ -1,7 +1,7 @@
/**
* Module dependencies
*/
import it from 'cafy';
import $ 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 = 10, limitErr] = it(params.limit).expect.number().range(1, 100).get();
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
if (limitErr) return rej('invalid limit param');
// Get history