import { IHelpCenterAuthor , IHelpCenterAuthorCreate , IHelpCenterAuthorFind } from '@gauzy/contracts' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { Injectable } from '@angular/core' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( { providedIn : 'root' } ) export class HelpCenterAuthorService { constructor ( private http ) { } createBulk ( input ) { return firstValueFrom ( this . http . post < IHelpCenterAuthor [ ] > ( `${ API_PREFIX }/help-center-author/createBulk` , input ) ) ; } findByArticleId ( articleId ) { return firstValueFrom ( this . http . get < IHelpCenterAuthor [ ] > ( `${ API_PREFIX }/help-center-author/article/${ articleId }` ) ) ; } deleteBulkByArticleId ( articleId ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/help-center-author/article/${ articleId }` ) ) ; } getAll ( relations ? , findInput ? ) { const data = JSON . stringify ( { relations , findInput } ) ; return firstValueFrom ( this . http . get < { items : IHelpCenterAuthor [ ] ; total : number ; } > ( `${ API_PREFIX }/help-center-author` , { params : { data } } ) ) ; } }