import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { ICandidateExperience , IExperienceCreateInput , IExperienceFindInput } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( { providedIn : 'root' } ) export class CandidateExperienceService { constructor ( private http ) { } create ( createInput ) { return firstValueFrom ( this . http . post < ICandidateExperience > ( `${ API_PREFIX }/candidate-experience` , createInput ) ) ; } getAll ( findInput ? , relations ? ) { const data = JSON . stringify ( { findInput , relations } ) ; return firstValueFrom ( this . http . get < { items : ICandidateExperience [ ] ; total : number ; } > ( `${ API_PREFIX }/candidate-experience` , { params : { data } } ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/candidate-experience/${ id }` , updateInput ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-experience/${ id }` ) ) ; } }