From e279c04e625781c4033cfd6d5ec1315b52f45431 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Thu, 26 Mar 2020 14:05:50 +0100 Subject: [PATCH] AW-1037 Add itemtasklist to service. --- projects/common/src/fm/models/itemTask.ts | 12 ++++++++++-- projects/common/src/fm/services/item.service.ts | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/projects/common/src/fm/models/itemTask.ts b/projects/common/src/fm/models/itemTask.ts index a95a260..acc0915 100644 --- a/projects/common/src/fm/models/itemTask.ts +++ b/projects/common/src/fm/models/itemTask.ts @@ -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() { } -} +} \ No newline at end of file diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index 31044b4..e2c92c2 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -148,5 +148,9 @@ 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): Observable { + return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`).pipe(map(ia => ia.map(i => this.parseDates(i)))); + } }