Compare commits

...

2 Commits

Author SHA1 Message Date
41a30e0b64 Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-08-20 10:02:37 +02:00
f14fc1a4fc Aw6020 Allow retrieving list items with date filter 2024-08-20 10:02:33 +02:00

View File

@ -79,7 +79,7 @@ export class ItemService {
return this.httpClient.get<IItem>(`${this.ApiEndpoint()}/api/v1/items/${code}/${itemType}`); return this.httpClient.get<IItem>(`${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<IItem[]> { getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date): Observable<IItem[]> {
let params = new HttpParams(); let params = new HttpParams();
if(itemType) params = params.append("it", itemType); if(itemType) params = params.append("it", itemType);
if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); 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 (validToday) params = params.append("vt", validToday ? "true" : "false");
if (tags) params = params.append("t", tags); if (tags) params = params.append("t", tags);
if (crs) params = params.append("crs", crs); 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<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }); return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
} }