type指定廃止

This commit is contained in:
syuilo 2018-08-02 09:30:57 +09:00
parent dfa5cb567f
commit ce0f6f7ebe

View file

@ -19,10 +19,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
const [markAsRead = true, markAsReadErr] = $.bool.optional.get(params.markAsRead); const [markAsRead = true, markAsReadErr] = $.bool.optional.get(params.markAsRead);
if (markAsReadErr) return rej('invalid markAsRead param'); if (markAsReadErr) return rej('invalid markAsRead param');
// Get 'type' parameter
const [type, typeErr] = $.arr($.str).optional.unique().get(params.type);
if (typeErr) return rej('invalid type param');
// Get 'limit' parameter // Get 'limit' parameter
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit); const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
if (limitErr) return rej('invalid limit param'); if (limitErr) return rej('invalid limit param');
@ -68,12 +64,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
}); });
} }
if (type) {
query.type = {
$in: type
};
}
if (sinceId) { if (sinceId) {
sort._id = 1; sort._id = 1;
query._id = { query._id = {