AW-6504 Support indexed on retrieving child items

This commit is contained in:
Peter Bastiani 2024-11-21 10:47:42 +01:00
parent 4a30707ec6
commit 8ab1611f39

View File

@ -116,7 +116,7 @@ export class ItemService {
getChildItemList(parentcode: string, itemType?: string, dataFilter?: any, level = 1, deep = true, getChildItemList(parentcode: string, itemType?: string, dataFilter?: any, level = 1, deep = true,
startDate?: Date, endDate?: Date, skip?: number, take?: number, startDate?: Date, endDate?: Date, skip?: number, take?: number,
exactMatchStartOrEndDate?: boolean, owner?:string): Observable<IItem[]> { exactMatchStartOrEndDate?: boolean, owner?:string, indexed?: boolean): Observable<IItem[]> {
let params = new HttpParams(); let params = new HttpParams();
if(itemType != null) { if(itemType != null) {
params = params.append("it", itemType); params = params.append("it", itemType);
@ -133,11 +133,13 @@ export class ItemService {
if(skip) params = params.append("skip", skip); if(skip) params = params.append("skip", skip);
if(take) params = params.append("take", take); if(take) params = params.append("take", take);
if(indexed) params = params.append("ind",indexed?"true":"false");
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params }); return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
} }
getChildItemListCount(parentcode: string, itemType?: string,dataFilter?: any, getChildItemListCount(parentcode: string, itemType?: string,dataFilter?: any,
startDate?: Date, endDate?: Date, exactMatchStartOrEndDate?: boolean, owner?:string): Observable<number> { startDate?: Date, endDate?: Date, exactMatchStartOrEndDate?: boolean, owner?:string,
indexed?: boolean): Observable<number> {
let params = new HttpParams(); let params = new HttpParams();
if(itemType != null) { if(itemType != null) {
params = params.append("it", itemType); params = params.append("it", itemType);
@ -149,6 +151,7 @@ export class ItemService {
if (endDate) params = params.append("eDate", endDate.toISOString()); if (endDate) params = params.append("eDate", endDate.toISOString());
if(exactMatchStartOrEndDate !== undefined) params = params.append("exactMatchStartOrEndDate", exactMatchStartOrEndDate); if(exactMatchStartOrEndDate !== undefined) params = params.append("exactMatchStartOrEndDate", exactMatchStartOrEndDate);
if(owner) params = params.append("owner", owner); if(owner) params = params.append("owner", owner);
if(indexed) params = params.append("ind",indexed?"true":"false");
return this.httpClient.get<number>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children/count`, { params: params }); return this.httpClient.get<number>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children/count`, { params: params });
} }