diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index 38d852c..2bfb265 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -24,7 +24,7 @@ export class ItemService { return this.httpClient.get<{ [id: string]: IItemType }>(`${this.ApiEndpoint()}/api/v1/itemtypes/`); } - getFeatures(extent: number[], crs: string, searchText?: string, searchTags?:string,startDate?:Date,endDate?:Date,itemType?:string,parentCode?:string,dataFilter?:string,level?:number): Observable { + getFeatures(extent: number[], crs: string, searchText?: string, searchTags?:string,startDate?:Date,endDate?:Date,itemType?:string,parentCode?:string,dataFilter?:string,level?:number,indexed?:boolean): Observable { var params = new HttpParams(); params = params.append("crs", crs); if (extent) params =params.append("bbox", extent.join(",")); @@ -42,6 +42,7 @@ export class ItemService { if (parentCode) params = params.append("pc", parentCode); if (dataFilter) params = params.append("df", dataFilter); if (level) params = params.append("lvl", level.toString()); + if (indexed) params = params.append("ind", level.toString()); return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/features/`, {params:params}); } @@ -73,10 +74,10 @@ export class ItemService { getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean): Observable { var params = new HttpParams(); - if(itemType) params = params.append("it", itemType); - if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); - if(atItemLocationItemCode) params = params.append("ail",atItemLocationItemCode); - if(indexed) params = params.append("ind",indexed?"true":"false"); + if(itemType) params = params.append("it", itemType); + if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); + if(atItemLocationItemCode) params = params.append("ail",atItemLocationItemCode); + if(indexed) params = params.append("ind",indexed?"true":"false"); if (level) params = params.append("lvl", level.toFixed()); if (validToday) params = params.append("vt", validToday ? "true" : "false"); return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }); @@ -127,11 +128,11 @@ export class ItemService { else return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${code}/features`, { params: params }); } - + postItem(item:IItem): Observable { return this.httpClient.post(`${this.ApiEndpoint()}/api/v1/items`,item); } - + putItem(item:IItem): Observable { return this.httpClient.put(`${this.ApiEndpoint()}/api/v1/items/${item.code}`,item); } @@ -158,7 +159,7 @@ export class ItemService { postItemTask(item: IItem, task: IItemTask): Observable { return this.httpClient.post(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task); } - + getItemTaskList(itemcode: string, unfinishedOnly?: boolean): Observable { var params = new HttpParams(); if (unfinishedOnly) params = params.append("unfinishedOnly", unfinishedOnly.toString()); @@ -167,8 +168,8 @@ export class ItemService { getItemListUsingRelationship(itemType: string, relationshipItemType: string, relationshipDataFilter: any): Observable { var params = new HttpParams(); - params = params.append("it", itemType); - params = params.append("rsit", relationshipItemType); + params = params.append("it", itemType); + params = params.append("rsit", relationshipItemType); params = params.append("rsdf", JSON.stringify(relationshipDataFilter)); return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/userelationship`, { params: params }); } @@ -177,4 +178,4 @@ export class ItemService { return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/value/layer/${layerIndex}?c=${x},${y}&crs=${crs}`); } -} \ No newline at end of file +}