import { HttpClient } from '@angular/common/http' ; import { Injectable } from '@angular/core' ; import { IRolePermission , IRolePermissionCreateInput , IRolePermissionUpdateInput } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; import { firstValueFrom } from 'rxjs' ; @ Injectable ( ) export class RolePermissionsService { constructor ( private readonly http ) { } getRolePermissions ( findInput ? ) { const data = JSON . stringify ( { findInput } ) ; return firstValueFrom ( this . http . get < any > ( `${ API_PREFIX }/role-permissions` , { params : { data } } ) ) ; } create ( createInput ) { return firstValueFrom ( this . http . post < IRolePermission > ( `${ API_PREFIX }/role-permissions` , createInput ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/role-permissions/${ id }` , updateInput ) ) ; } }