AW-1649 Remove codelistitem
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
import { ICodeListItem } from '../models/code.list.item';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CodeListItemService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
||||
ApiEndpoint() {
|
||||
return this.appConfig.getConfig("apiEndPoint");
|
||||
}
|
||||
|
||||
getCodeListItems(codelist: string[]): Observable<ICodeListItem[]> {
|
||||
var params = new HttpParams();
|
||||
for (const cl of codelist) {
|
||||
params = params.append('cl', cl);
|
||||
}
|
||||
return this.httpClient.get<ICodeListItem[]>(`${this.ApiEndpoint()}/api/v1/codelistitems/`, { params: params });
|
||||
}
|
||||
|
||||
getCodeListItem(codeList: string, code: string): Observable<ICodeListItem> {
|
||||
return this.httpClient.get<ICodeListItem>(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeList}/${code}`);
|
||||
}
|
||||
|
||||
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): Observable<any> {
|
||||
return this.httpClient.delete(`${this.ApiEndpoint()}/api/v1/codelistitems/${codelist}/${code}`);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user