parent
b5ff2abdb9
commit
395cfa6108
9 changed files with 25 additions and 9 deletions
|
@ -5,6 +5,7 @@ import { getFriends } from '../../common/get-friends';
|
|||
import { pack } from '../../../../models/note';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
import getParams from '../../get-params';
|
||||
import { countIf } from '../../../../prelude/array';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
|
@ -86,7 +87,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';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue