AW-942 Add (optional) deep parameter to getChildItemList.
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Peter Bastiani 2020-02-25 15:04:12 +01:00
parent d3b10d46ad
commit 9c103a0c40

View File

@ -75,13 +75,14 @@ export class ItemService {
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i)))); return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i))));
} }
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1): Observable<IItem[]> { getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
var params = new HttpParams(); var params = new HttpParams();
params = params.append("it", itemType); params = params.append("it", itemType);
if (dataFilter != null) { if (dataFilter != null) {
params = params.append("df", JSON.stringify(dataFilter)); params = params.append("df", JSON.stringify(dataFilter));
} }
params = params.append("lvl", level.toString()); params = params.append("lvl", level.toString());
params = params.append("deep", deep.toString());
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i)))); return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i))));
} }