Merge branch 'develop' of https://github.com/syuilo/misskey into develop

This commit is contained in:
syuilo 2018-09-06 04:28:42 +09:00
commit ccf8e44acc
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
17 changed files with 59 additions and 25 deletions

View file

@ -4,6 +4,7 @@ import Mute from '../../../../models/mute';
import { pack } from '../../../../models/note';
import { ILocalUser } from '../../../../models/user';
import getParams from '../../get-params';
import { countIf } from '../../../../prelude/array';
export const meta = {
desc: {
@ -48,7 +49,7 @@ export default async (params: any, user: ILocalUser) => {
if (psErr) throw psErr;
// Check if only one of sinceId, untilId, sinceDate, untilDate specified
if ([ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate].filter(x => x != null).length > 1) {
if (countIf(x => x != null, [ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate]) > 1) {
throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified';
}