From 73e01d6f406e80786ce0f1ddb2e06a02969ff3c0 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Sat, 21 Dec 2019 17:13:07 -0300 Subject: [PATCH] 15019: Changes joinFilters() to accept variable number of args. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/services/api/filter-builder.ts | 4 ++-- src/services/favorite-service/favorite-service.ts | 2 +- src/services/project-service/project-service.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/api/filter-builder.ts b/src/services/api/filter-builder.ts index aa0f011b..102ff62c 100644 --- a/src/services/api/filter-builder.ts +++ b/src/services/api/filter-builder.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: AGPL-3.0 -export function joinFilters(filters0?: string, filters1?: string) { - return [filters0, filters1].filter(s => s).join(","); +export function joinFilters(...filters: string[]) { + return filters.filter(s => s).join(","); } export class FilterBuilder { diff --git a/src/services/favorite-service/favorite-service.ts b/src/services/favorite-service/favorite-service.ts index 8b504c86..90849c8b 100644 --- a/src/services/favorite-service/favorite-service.ts +++ b/src/services/favorite-service/favorite-service.ts @@ -53,7 +53,7 @@ export class FavoriteService { return this.linkService .list({ - filters: joinFilters(filters, listFilters), + filters: joinFilters(filters || '', listFilters), limit, offset, order: linkOrder diff --git a/src/services/project-service/project-service.ts b/src/services/project-service/project-service.ts index eec5a940..4ae91d4d 100644 --- a/src/services/project-service/project-service.ts +++ b/src/services/project-service/project-service.ts @@ -18,7 +18,7 @@ export class ProjectService extends GroupsService { return super.list({ ...args, filters: joinFilters( - args.filters, + args.filters || '', new FilterBuilder() .addEqual("group_class", GroupClass.PROJECT) .getFilters() -- 2.30.2