import { IHelpCenter , IHelpCenterFind } from '@gauzy/contracts' ; import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( { providedIn : 'root' } ) export class HelpCenterService { constructor ( private http ) { } create ( createInput ) { return firstValueFrom ( this . http . post < IHelpCenter > ( `${ API_PREFIX }/help-center` , createInput ) ) ; } getAll ( relations ? , findInput ? ) { const data = JSON . stringify ( { relations , findInput } ) ; return firstValueFrom ( this . http . get < { items : IHelpCenter [ ] ; total : number ; } > ( `${ API_PREFIX }/help-center` , { params : { data } } ) ) ; } updateBulk ( oldChildren , newChildren ) { return firstValueFrom ( this . http . post < IHelpCenter [ ] > ( `${ API_PREFIX }/help-center/updateBulk` , { oldChildren , newChildren } ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/help-center/${ id }` , updateInput ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/help-center/${ id }` ) ) ; } findByBaseId ( parentId ) { return firstValueFrom ( this . http . get < IHelpCenter [ ] > ( `${ API_PREFIX }/help-center/base/${ parentId }` ) ) ; } deleteBulkByBaseId ( parentId ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/help-center/base/${ parentId }` ) ) ; } }