From 7117ac06d16a2d4bba69c89d182490b1a48fb27b Mon Sep 17 00:00:00 2001 From: wibus-wee <1596355173@qq.com> Date: Tue, 24 Jan 2023 22:31:36 +0800 Subject: [PATCH] perf(config): rename config `webhook` to `webhooks` --- .../src/notification-service.service.ts | 2 +- libs/config/src/config.dto.ts | 2 +- libs/config/src/config.interface.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) 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()