From f14fc1a4fc1343cd390a37ec65177edcfebea42a Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Tue, 20 Aug 2024 10:02:33 +0200 Subject: [PATCH] Aw6020 Allow retrieving list items with date filter --- projects/common/src/fm/services/item.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index c302639..0fce602 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -79,7 +79,7 @@ export class ItemService { return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${code}/${itemType}`); } - getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string): Observable { + getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date): Observable { let params = new HttpParams(); if(itemType) params = params.append("it", itemType); if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); @@ -89,6 +89,8 @@ export class ItemService { if (validToday) params = params.append("vt", validToday ? "true" : "false"); if (tags) params = params.append("t", tags); if (crs) params = params.append("crs", crs); + if (startDate) params = params.append("sDate", startDate.toISOString()); + if (endDate) params = params.append("eDate", endDate.toISOString()); return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }); }