Aw5812 Update item file
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter Bastiani 2024-01-29 16:25:56 +01:00
parent 4d5ed915ad
commit 2e40d023b1

View File

@ -152,6 +152,13 @@ export class ItemService {
return this.httpClient.put<IItem>(`${this.ApiEndpoint()}/api/v1/items/${item.code}`,item);
}
putItemFile(item: IItem, jsonObject: any): Observable<IItem> {
const formData = new FormData();
const file = new File([JSON.stringify(jsonObject)], 'data.dat', {type: 'application/json'});
formData.append('file', file);
return this.httpClient.put<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`, formData);
}
deleteItem(code: string): Observable<any> {
return this.httpClient.delete<any>(`${this.ApiEndpoint()}/api/v1/items/${code}`);
}
@ -196,5 +203,4 @@ export class ItemService {
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
}
}