diff --git a/src/api/routes/instance.router.ts b/src/api/routes/instance.router.ts index ca74f807..21f8ef6b 100644 --- a/src/api/routes/instance.router.ts +++ b/src/api/routes/instance.router.ts @@ -21,7 +21,7 @@ export class InstanceRouter extends RouterBroker { return res.status(HttpStatus.CREATED).json(response); }) - .put(this.routerPath('restart'), ...guards, async (req, res) => { + .post(this.routerPath('restart'), ...guards, async (req, res) => { const response = await this.dataValidate({ request: req, schema: null, diff --git a/src/api/services/channels/whatsapp.baileys.service.ts b/src/api/services/channels/whatsapp.baileys.service.ts index d280d008..388dd6e6 100644 --- a/src/api/services/channels/whatsapp.baileys.service.ts +++ b/src/api/services/channels/whatsapp.baileys.service.ts @@ -1826,10 +1826,8 @@ export class BaileysStartupService extends ChannelStartupService { { ...option, useCachedGroupMetadata: - !this.configService.get('CACHE').REDIS.ENABLED && - !this.configService.get('CACHE').LOCAL.ENABLED - ? false - : true, + !!this.configService.get('CACHE').REDIS.ENABLED && + !!this.configService.get('CACHE').LOCAL.ENABLED, } as unknown as MiscMessageGenerationOptions, ); } @@ -1845,10 +1843,8 @@ export class BaileysStartupService extends ChannelStartupService { { ...option, useCachedGroupMetadata: - !this.configService.get('CACHE').REDIS.ENABLED && - !this.configService.get('CACHE').LOCAL.ENABLED - ? false - : true, + !!this.configService.get('CACHE').REDIS.ENABLED && + !!this.configService.get('CACHE').LOCAL.ENABLED, } as unknown as MiscMessageGenerationOptions, ); } @@ -1866,10 +1862,8 @@ export class BaileysStartupService extends ChannelStartupService { { ...option, useCachedGroupMetadata: - !this.configService.get('CACHE').REDIS.ENABLED && - !this.configService.get('CACHE').LOCAL.ENABLED - ? false - : true, + !!this.configService.get('CACHE').REDIS.ENABLED && + !!this.configService.get('CACHE').LOCAL.ENABLED, } as unknown as MiscMessageGenerationOptions, ); } @@ -1892,10 +1886,8 @@ export class BaileysStartupService extends ChannelStartupService { { ...option, useCachedGroupMetadata: - !this.configService.get('CACHE').REDIS.ENABLED && - !this.configService.get('CACHE').LOCAL.ENABLED - ? false - : true, + !!this.configService.get('CACHE').REDIS.ENABLED && + !!this.configService.get('CACHE').LOCAL.ENABLED, } as unknown as MiscMessageGenerationOptions, ); })(); @@ -2003,6 +1995,8 @@ export class BaileysStartupService extends ChannelStartupService { public async setPresence(data: SetPresenceDto) { try { await this.client.sendPresenceUpdate(data.presence); + + return { presence: data.presence }; } catch (error) { this.logger.error(error); throw new BadRequestException(error.toString()); diff --git a/src/validate/instance.schema.ts b/src/validate/instance.schema.ts index 2fdcc4c4..ee306164 100644 --- a/src/validate/instance.schema.ts +++ b/src/validate/instance.schema.ts @@ -171,14 +171,6 @@ export const instanceSchema: JSONSchema7 = { chatwootMergeBrazilContacts: { type: 'boolean' }, chatwootImportMessages: { type: 'boolean' }, chatwootDaysLimitImportMessages: { type: 'number' }, - // Typebot - typebotUrl: { type: 'string' }, - typebot: { type: 'boolean' }, - typebotExpire: { type: 'number' }, - typebotKeywordFinish: { type: 'string' }, - typebotDelayMessage: { type: 'number' }, - typebotUnknownMessage: { type: 'string' }, - typebotListeningFromMe: { type: 'boolean' }, }, ...isNotEmpty('instanceName'), };