import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { ICandidateInterviewersFindInput , ICandidateInterviewersCreateInput , ICandidateInterviewers , ICandidateInterviewersDeleteInput } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( ) export class CandidateInterviewersService { constructor ( private http ) { } create ( createInput ) { return firstValueFrom ( this . http . post < ICandidateInterviewers > ( `${ API_PREFIX }/candidate-interviewers` , createInput ) ) ; } createBulk ( createInput ) { return firstValueFrom ( this . http . post < ICandidateInterviewers [ ] > ( `${ API_PREFIX }/candidate-interviewers/bulk` , createInput ) ) ; } getAll ( findInput ? ) { const data = JSON . stringify ( { findInput } ) ; return firstValueFrom ( this . http . get < { items : ICandidateInterviewers [ ] ; total : number ; } > ( `${ API_PREFIX }/candidate-interviewers` , { params : { data } } ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/candidate-interviewers/${ id }` , updateInput ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-interviewers/${ id }` ) ) ; } findByInterviewId ( interviewId ) { return firstValueFrom ( this . http . get < ICandidateInterviewers [ ] > ( `${ API_PREFIX }/candidate-interviewers/interview/${ interviewId }` ) ) ; } deleteBulkByInterviewId ( interviewId ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-interviewers/interview/${ interviewId }` ) ) ; } deleteBulkByEmployeeId ( deleteInput ) { const data = JSON . stringify ( { deleteInput } ) ; return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-interviewers/deleteBulkByEmployeeId` , { params : { data } } ) ) ; } }