refactor api services (#44)
Reviewed-on: http://git.simonis.lol/angular/ems-frontend/pulls/44 Reviewed-by: Huy <ptran@noreply@simonis.lol> Co-authored-by: Constantin Simonis <constantin@simonis.lol> Co-committed-by: Constantin Simonis <constantin@simonis.lol>
This commit is contained in:
parent
905ddcdf2a
commit
9d22662cf1
@ -10,7 +10,7 @@ import {Employee} from "../employee/Employee";
|
|||||||
export default class EmployeeApiService {
|
export default class EmployeeApiService {
|
||||||
private http: HttpClient = inject(HttpClient);
|
private http: HttpClient = inject(HttpClient);
|
||||||
|
|
||||||
private static readonly BASE_URL = 'http://localhost:8089';
|
private static readonly BASE_URL = '/backend';
|
||||||
|
|
||||||
public getById(id: number): Observable<Employee> {
|
public getById(id: number): Observable<Employee> {
|
||||||
return this.http.get(`${EmployeeApiService.BASE_URL}/employees/${id}`)
|
return this.http.get(`${EmployeeApiService.BASE_URL}/employees/${id}`)
|
||||||
|
@ -11,7 +11,7 @@ import {Employee} from "../employee/Employee";
|
|||||||
export default class QualificationService {
|
export default class QualificationService {
|
||||||
private http: HttpClient = inject(HttpClient);
|
private http: HttpClient = inject(HttpClient);
|
||||||
|
|
||||||
private static readonly BASE_URL = 'http://localhost:8089';
|
private static readonly BASE_URL = '/backend';
|
||||||
|
|
||||||
public getAll(): Observable<Qualification[]> {
|
public getAll(): Observable<Qualification[]> {
|
||||||
return this.http.get<Qualification[]>(`${QualificationService.BASE_URL}/qualifications`).pipe(
|
return this.http.get<Qualification[]>(`${QualificationService.BASE_URL}/qualifications`).pipe(
|
||||||
|
Reference in New Issue
Block a user