mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 03:42:23 -06:00
feat: update API routes and services for better cache handling
Modified instance.router.ts to change HTTP method from PUT to POST for 'restart' route. Updated whatsapp.baileys.service.ts to correct cache configuration logic, ensuring proper usage of cached group metadata. Removed obsolete Typebot-related schema definitions from instance.schema.ts for cleaner validation. These changes improve API functionality and maintainability.
This commit is contained in:
@@ -1826,10 +1826,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
{
|
||||
...option,
|
||||
useCachedGroupMetadata:
|
||||
!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED
|
||||
? false
|
||||
: true,
|
||||
!!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED,
|
||||
} as unknown as MiscMessageGenerationOptions,
|
||||
);
|
||||
}
|
||||
@@ -1845,10 +1843,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
{
|
||||
...option,
|
||||
useCachedGroupMetadata:
|
||||
!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED
|
||||
? false
|
||||
: true,
|
||||
!!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED,
|
||||
} as unknown as MiscMessageGenerationOptions,
|
||||
);
|
||||
}
|
||||
@@ -1866,10 +1862,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
{
|
||||
...option,
|
||||
useCachedGroupMetadata:
|
||||
!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED
|
||||
? false
|
||||
: true,
|
||||
!!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED,
|
||||
} as unknown as MiscMessageGenerationOptions,
|
||||
);
|
||||
}
|
||||
@@ -1892,10 +1886,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
{
|
||||
...option,
|
||||
useCachedGroupMetadata:
|
||||
!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!this.configService.get<CacheConf>('CACHE').LOCAL.ENABLED
|
||||
? false
|
||||
: true,
|
||||
!!this.configService.get<CacheConf>('CACHE').REDIS.ENABLED &&
|
||||
!!this.configService.get<CacheConf>('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());
|
||||
|
||||
Reference in New Issue
Block a user