Fixed smsApiKey index error and err handling in ESG

This commit is contained in:
SepehrYahyaee
2026-06-21 12:18:08 +03:30
parent 570fa865de
commit d0e7694374
6 changed files with 56 additions and 28 deletions

View File

@@ -114,6 +114,7 @@ export class ClientService {
) {}
async addClient(client: ClientDto): Promise<ClientDtoRs> {
try {
const smsApiKey = client.property?.smsApiKey?.trim();
const newClient = await this.clientDbService.create({
clientCode: client.clientCode,
@@ -129,9 +130,7 @@ export class ClientService {
: (client.clientName?.english ?? null),
},
property: {
smsApiKey: client.property?.smsApiKey ?? null,
},
...(smsApiKey ? { property: { smsApiKey } } : {}),
useExpertMode: client.useExpertMode ?? null,
});