import { IHelpCenterArticle } 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 HelpCenterArticleService { constructor ( private http ) { } create ( createInput ) { return firstValueFrom ( this . http . post < IHelpCenterArticle > ( `${ API_PREFIX }/help-center-article` , createInput ) ) ; } findByCategoryId ( categoryId ) { return firstValueFrom ( this . http . get < IHelpCenterArticle [ ] > ( `${ API_PREFIX }/help-center-article/category/${ categoryId }` ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/help-center-article/${ id }` , updateInput ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/help-center-article/${ id }` ) ) ; } deleteBulkByCategoryId ( categoryId ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/help-center-article/category/${ categoryId }` ) ) ; } }