import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { ITenant , ITenantCreateInput , ITenantSetting } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( ) export class TenantService { constructor ( private http ) { } API_URL = `${ API_PREFIX }/tenant` ; create ( createInput ) { return firstValueFrom ( this . http . post < ITenant > ( `${ this . API_URL }` , createInput ) ) ; } getSettings ( ) { return firstValueFrom ( this . http . get < ITenantSetting > ( `${ API_PREFIX }/tenant-setting` ) ) ; } saveSettings ( request ) { return firstValueFrom ( this . http . post < ITenantSetting > ( `${ API_PREFIX }/tenant-setting` , request ) ) ; } }