AW-1037 Add filter parameter
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Peter Bastiani 2020-03-27 15:53:26 +01:00
parent bf883a779f
commit 8ef248b0a7

View File

@ -149,8 +149,9 @@ export class ItemService {
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task); return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task);
} }
getItemTaskList(itemcode: string): Observable<IItemTask[]> { getItemTaskList(itemcode: string, unfinishedOnly?: boolean): Observable<IItemTask[]> {
return this.httpClient.get<IItemTask[]>(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`).pipe(map(ia => ia.map(i => this.parseDates(i)))); var params = new HttpParams();
if (unfinishedOnly) params = params.append("unfinishedOnly", unfinishedOnly.toString());
return this.httpClient.get<IItemTask[]>(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i))));
} }
} }