You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
922 B
TypeScript
28 lines
922 B
TypeScript
import { HttpHeaders } from '@angular/common/http';
|
|
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { environment } from '../../../environments/environment';
|
|
import { ServiceModel } from '../../models/services/ServiceModel';
|
|
import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service';
|
|
|
|
@Injectable()
|
|
export class ServicesDataService {
|
|
|
|
private actionUrl: string;
|
|
private headers: HttpHeaders;
|
|
|
|
constructor(private http: BaseHttpService) {
|
|
|
|
this.actionUrl = environment.Server + 'services/';
|
|
|
|
this.headers = new HttpHeaders();
|
|
this.headers = this.headers.set('Content-Type', 'application/json');
|
|
this.headers = this.headers.set('Accept', 'application/json');
|
|
}
|
|
|
|
create(serviceModel: ServiceModel): Observable<ServiceModel> {
|
|
return this.http.post<ServiceModel>(this.actionUrl + 'create', serviceModel, { headers: this.headers });
|
|
}
|
|
|
|
}
|