Await chatwoot creation and change log to error

This commit is contained in:
Judson Cairo 2024-09-01 16:46:09 -03:00
parent 2cb68b38a9
commit 1161a8a0e2
2 changed files with 4 additions and 3 deletions

View File

@ -204,7 +204,7 @@ export class InstanceController {
const urlServer = this.configService.get<HttpServer>('SERVER').URL; const urlServer = this.configService.get<HttpServer>('SERVER').URL;
try { try {
this.chatwootService.create(instance, { await this.chatwootService.create(instance, {
enabled: true, enabled: true,
accountId: instanceData.chatwootAccountId, accountId: instanceData.chatwootAccountId,
token: instanceData.chatwootToken, token: instanceData.chatwootToken,
@ -220,10 +220,10 @@ export class InstanceController {
daysLimitImportMessages: instanceData.chatwootDaysLimitImportMessages ?? 60, daysLimitImportMessages: instanceData.chatwootDaysLimitImportMessages ?? 60,
organization: instanceData.chatwootOrganization, organization: instanceData.chatwootOrganization,
logo: instanceData.chatwootLogo, logo: instanceData.chatwootLogo,
autoCreate: instanceData.chatwootAutoCreate !== false, autoCreate: instanceData.chatwootAutoCreate ?? true,
}); });
} catch (error) { } catch (error) {
this.logger.log(error); this.logger.error(error);
} }
return { return {

View File

@ -36,5 +36,6 @@ export function ChatwootInstanceMixin<TBase extends Constructor>(Base: TBase) {
chatwootNameInbox?: string; chatwootNameInbox?: string;
chatwootOrganization?: string; chatwootOrganization?: string;
chatwootLogo?: string; chatwootLogo?: string;
chatwootAutoCreate?: boolean;
}; };
} }