import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { Observable } from 'rxjs' ; import { IOrganizationDocument , IOrganizationDocumentFindInput } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( { providedIn : 'root' } ) export class OrganizationDocumentsService { constructor ( private http ) { } create ( newDocument ) { return this . http . post < IOrganizationDocument > ( `${ API_PREFIX }/organization-documents` , newDocument ) ; } getAll ( findInput ) { const data = JSON . stringify ( { findInput } ) ; return this . http . get < { items : IOrganizationDocument [ ] ; total : number ; } > ( `${ API_PREFIX }/organization-documents` , { params : { data } } ) ; } update ( id , updateInput ) { return this . http . put < IOrganizationDocument > ( `${ API_PREFIX }/organization-documents/${ id }` , updateInput ) ; } delete ( id ) { return this . http . delete < IOrganizationDocument > ( `${ API_PREFIX }/organization-documents/${ id }` ) ; } }