Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Bastiani 8db1edb262 Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
FarmMaps.Develop/FarmMapsLib/develop This commit looks good Details
2020-03-26 14:06:32 +01:00
Peter Bastiani e279c04e62 AW-1037 Add itemtasklist to service. 2020-03-26 14:05:50 +01:00
2 changed files with 14 additions and 2 deletions

View File

@ -2,14 +2,22 @@
export interface IItemTask {
code?: string;
taskType?: string;
attributes?:any
attributes?: any;
message?: string,
state?: number,
started?: Date,
finished?: Date
}
export class ItemTask implements IItemTask {
public code?:string;
public taskType?: string;
public attributes?: any;
public message?: string;
public state?: number;
public started?: Date;
public finished?: Date;
constructor() {
}
}
}

View File

@ -148,5 +148,9 @@ export class ItemService {
postItemTask(item: IItem, task: IItemTask): Observable<IItemTask> {
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task);
}
getItemTaskList(itemcode: string): Observable<IItemTask[]> {
return this.httpClient.get<IItemTask[]>(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`).pipe(map(ia => ia.map(i => this.parseDates(i))));
}
}