import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { ICustomSmtp , ICustomSmtpFindInput } from '@gauzy/contracts' ; import { toParams } from '@gauzy/common-angular' ; import { API_PREFIX } from '../constants/app.constants' ; import { firstValueFrom } from 'rxjs' ; @ Injectable ( ) export class CustomSmtpService { API_URL = `${ API_PREFIX }/smtp` ; constructor ( private http ) { } saveSMTPSetting ( request ) { return firstValueFrom ( this . http . post < ICustomSmtp > ( `${ this . API_URL }` , request ) ) ; } updateSMTPSetting ( id , request ) { return firstValueFrom ( this . http . put < ICustomSmtp > ( `${ this . API_URL }/${ id }` , request ) ) ; } getSMTPSetting ( request ) { return firstValueFrom ( this . http . get < ICustomSmtp > ( `${ this . API_URL }/setting` , { params : toParams ( request ) } ) ) ; } validateSMTPSetting ( request ) { return firstValueFrom ( this . http . post < boolean > ( `${ this . API_URL }/validate` , request ) ) ; } }