added codelist service
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Francisco Salas 2020-10-08 14:25:33 +02:00
parent 640c99cde2
commit ac8ab147bc

View File

@ -22,4 +22,16 @@ export class CodeListItemService {
}
return this.httpClient.get<ICodeListItem[]>(`${this.ApiEndpoint()}/api/v1/codelistitems/`, { params: params });
}
postCodeListItem(codeListItem: ICodeListItem): Observable<ICodeListItem> {
return this.httpClient.post<ICodeListItem>(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeListItem.codeList}`, codeListItem);
}
putCodeListItem(codeListItem: ICodeListItem): Observable<ICodeListItem> {
return this.httpClient.put<ICodeListItem>(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeListItem.codeList}`, codeListItem);
}
deleteCodeListItem(codelist: string, code: string) {
return this.httpClient.delete(`${this.ApiEndpoint()}/api/v1/codelistitems/${codelist}/${code}`);
}
}