Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(settings): stop reporting webhook alerts as enabled
Yudhi Armyndharisec049fe9036a
diff --git a/src/modules/settings/dto/settings-response.dto.ts b/src/modules/settings/dto/settings-response.dto.tsindex cdb72d1af..99e25b614 100644--- a/src/modules/settings/dto/settings-response.dto.ts+++ b/src/modules/settings/dto/settings-response.dto.ts@@ -39,10 +39,13 @@ export class SettingsApiDto {enableDocs!: boolean;}+const NOTIFICATION_PLACEHOLDER =+ 'Fixed placeholder: no notification feature exists, and the value is not configurable.';+export class SettingsNotificationsDto {- @ApiProperty({ example: false }) emailEnabled!: boolean;- @ApiProperty({ example: '' }) notificationEmail!: string;- @ApiProperty({ example: true }) webhookAlerts!: boolean;+ @ApiProperty({ description: `Always false. ${NOTIFICATION_PLACEHOLDER}`, example: false }) emailEnabled!: boolean;+ @ApiProperty({ description: `Always empty. ${NOTIFICATION_PLACEHOLDER}`, example: '' }) notificationEmail!: string;+ @ApiProperty({ description: `Always false. ${NOTIFICATION_PLACEHOLDER}`, example: false }) webhookAlerts!: boolean;}export class SettingsResponseDto {diff --git a/src/modules/settings/settings.controller.spec.ts b/src/modules/settings/settings.controller.spec.tsindex 32cc9a6d7..89b6dee6c 100644--- a/src/modules/settings/settings.controller.spec.ts+++ b/src/modules/settings/settings.controller.spec.ts@@ -37,6 +37,14 @@ describe('SettingsController', () => {}});+ it('reports no notification feature as enabled, since none exists', () => {+ expect(new SettingsController(configStub).get().notifications).toEqual({+ emailEnabled: false,+ notificationEmail: '',+ webhookAlerts: false,+ });+ });+it('reports enableDocs from the real ENABLE_SWAGGER gate, not a hardcoded true', () => {const prev = process.env.ENABLE_SWAGGER;try {diff --git a/src/modules/settings/settings.controller.ts b/src/modules/settings/settings.controller.tsindex 375a8b1dc..f89d13372 100644--- a/src/modules/settings/settings.controller.ts+++ b/src/modules/settings/settings.controller.ts@@ -52,10 +52,11 @@ export class SettingsController {// — otherwise the panel reports docs enabled in production where they are actually disabled.enableDocs: isSwaggerEnabled(process.env.ENABLE_SWAGGER, process.env.NODE_ENV),},+ // Fixed placeholders: no notification feature exists, so nothing here may report one as on.notifications: {emailEnabled: false,notificationEmail: '',- webhookAlerts: true,+ webhookAlerts: false,},};}