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;
try {
this.chatwootService.create(instance, {
await this.chatwootService.create(instance, {
enabled: true,
accountId: instanceData.chatwootAccountId,
token: instanceData.chatwootToken,
@ -220,10 +220,10 @@ export class InstanceController {
daysLimitImportMessages: instanceData.chatwootDaysLimitImportMessages ?? 60,
organization: instanceData.chatwootOrganization,
logo: instanceData.chatwootLogo,
autoCreate: instanceData.chatwootAutoCreate !== false,
autoCreate: instanceData.chatwootAutoCreate ?? true,
});
} catch (error) {
this.logger.log(error);
this.logger.error(error);
}
return {

View File

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