import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { ConfigurationService } from '../configuration/configuration.service'; import { BaseHttpService } from '../http/base-http.service'; import { Observable } from 'rxjs'; import { DataTableData } from '@app/core/model/data-table/data-table-data'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; @Injectable() export class DescriptionTemplateTypeService { private actionUrl: string; private headers = new HttpHeaders(); constructor(private http: BaseHttpService, private httpClient: HttpClient, private configurationService: ConfigurationService) { this.actionUrl = configurationService.server + 'descriptionTemplateType/'; } getTypes(): Observable> { return this.http.get>(this.actionUrl + 'get', { headers: this.headers }); } createType(name: string): Observable { return this.http.post(this.actionUrl + 'create', name, { headers: this.headers }); } deleteType(id: string): Observable { return this.http.delete(this.actionUrl + 'delete/' + id, { headers: this.headers }); } }