From 8ef248b0a72412e4507e56eae963a15922376f2d Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Fri, 27 Mar 2020 15:53:26 +0100 Subject: [PATCH] AW-1037 Add filter parameter --- projects/common/src/fm/services/item.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index e2c92c2..8d1185c 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -149,8 +149,9 @@ export class ItemService { return this.httpClient.post(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task); } - getItemTaskList(itemcode: string): Observable { - return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`).pipe(map(ia => ia.map(i => this.parseDates(i)))); + getItemTaskList(itemcode: string, unfinishedOnly?: boolean): Observable { + var params = new HttpParams(); + if (unfinishedOnly) params = params.append("unfinishedOnly", unfinishedOnly.toString()); + return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i)))); } -} - +} \ No newline at end of file