Refactor itemtype loading
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
@@ -6,12 +6,13 @@ import { IItem } from '../models/item';
|
||||
import { IItemTask } from '../models/itemTask';
|
||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
import {ItemTypeService} from './itemtype.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ItemService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig,private itemTypeService:ItemTypeService) {
|
||||
}
|
||||
|
||||
ApiEndpoint() {
|
||||
@@ -37,7 +38,13 @@ export class ItemService {
|
||||
if (searchTags) params = params.append("t", searchTags);
|
||||
if (startDate) params = params.append("sd", startDate.toISOString());
|
||||
if (endDate) params = params.append("ed", endDate.toISOString());
|
||||
if (itemType) params = params.append("it", itemType);
|
||||
if (itemType) {
|
||||
params = params.append("it", itemType);
|
||||
let extraAttributes = this.itemTypeService.getExtraAttributes(itemType);
|
||||
if(extraAttributes) {
|
||||
params = params.append("da", extraAttributes);
|
||||
}
|
||||
}
|
||||
if (parentCode) params = params.append("pc", parentCode);
|
||||
if (dataFilter) params = params.append("df", dataFilter);
|
||||
if (level) params = params.append("lvl", dataFilter);
|
||||
|
Reference in New Issue
Block a user