diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index 970727b..448e7f3 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -79,7 +79,9 @@ 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, startDate?: Date, endDate?: Date): Observable { + getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, + indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date, + skip?: number, take?: number): Observable { let params = new HttpParams(); if(itemType) params = params.append("it", itemType); if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); @@ -91,8 +93,18 @@ export class ItemService { if (crs) params = params.append("crs", crs); if (startDate) params = params.append("sDate", startDate.toISOString()); if (endDate) params = params.append("eDate", endDate.toISOString()); + if(skip) params = params.append("skip", skip); + if(take) params = params.append("take", take); return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }); } + + getItemListCount(itemType: string, startDate?: Date, endDate?: Date): Observable { + let params = new HttpParams(); + params = params.append("it", itemType); + 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/count`, { params: params }); + } getChildItemList(parentcode: string, itemType?: string, dataFilter?: any, level = 1, deep = true, startDate?: Date, endDate?: Date, skip?: number, take?: number): Observable {