import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { IEmployeeLevelInput , IEmployeeLevel , IEmployeeLevelFindInput , IPagination } from '@gauzy/contracts' ; import { firstValueFrom } from 'rxjs' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( { providedIn : 'root' } ) export class EmployeeLevelService { constructor ( private http ) { } getAll ( relations ? , findInput ? ) { const data = JSON . stringify ( { relations : relations || [ ] , findInput } ) ; return firstValueFrom ( this . http . get < IPagination < IEmployeeLevel > > ( `${ API_PREFIX }/employee-level` , { params : { data } } ) ) ; } create ( employeeLevel ) { return firstValueFrom ( this . http . post ( `${ API_PREFIX }/employee-level` , employeeLevel ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/employee-level/${ id }` ) ) ; } update ( id , employeeLevel ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/employee-level/${ id }` , employeeLevel ) ) ; } }