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