diff --git a/apps/notification-service/src/notification-service.service.ts b/apps/notification-service/src/notification-service.service.ts index a0c291024..3b5cf747c 100644 --- a/apps/notification-service/src/notification-service.service.ts +++ b/apps/notification-service/src/notification-service.service.ts @@ -14,7 +14,7 @@ export class NotificationService { async getWebhookInEvent(event: string) { const res: string[] = []; - const webhooks = await this.config.get('webhook'); + const webhooks = await this.config.get('webhooks'); if (!webhooks) return; for (const webhook of webhooks) { if (webhook.events.includes(event)) { diff --git a/libs/config/src/config.dto.ts b/libs/config/src/config.dto.ts index a5c8822fc..afc5804ec 100644 --- a/libs/config/src/config.dto.ts +++ b/libs/config/src/config.dto.ts @@ -44,7 +44,7 @@ export class SiteDto { serverUrl: string; } -export class WebhookDto { +export class WebhooksDto { @IsString() @IsNotEmpty() name: string; diff --git a/libs/config/src/config.interface.ts b/libs/config/src/config.interface.ts index 3a90a04fb..d75b0ef16 100644 --- a/libs/config/src/config.interface.ts +++ b/libs/config/src/config.interface.ts @@ -9,7 +9,7 @@ import { Type } from 'class-transformer'; import { ValidateNested } from 'class-validator'; -import { EmailDto, SeoDto, SiteDto, WebhookDto } from './config.dto'; +import { EmailDto, SeoDto, SiteDto, WebhooksDto } from './config.dto'; export abstract class ConfigsInterface { @Type(() => SeoDto) @@ -20,9 +20,9 @@ export abstract class ConfigsInterface { @ValidateNested() site: SiteDto; - @Type(() => WebhookDto) + @Type(() => WebhooksDto) @ValidateNested() - webhook: WebhookDto[]; + webhooks: WebhooksDto[]; @Type(() => EmailDto) @ValidateNested()