Skip to content

Commit

Permalink
perf(config): rename config webhook to webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jan 24, 2023
1 parent ff7c365 commit 7117ac0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion libs/config/src/config.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SiteDto {
serverUrl: string;
}

export class WebhookDto {
export class WebhooksDto {
@IsString()
@IsNotEmpty()
name: string;
Expand Down
6 changes: 3 additions & 3 deletions libs/config/src/config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -20,9 +20,9 @@ export abstract class ConfigsInterface {
@ValidateNested()
site: SiteDto;

@Type(() => WebhookDto)
@Type(() => WebhooksDto)
@ValidateNested()
webhook: WebhookDto[];
webhooks: WebhooksDto[];

@Type(() => EmailDto)
@ValidateNested()
Expand Down

0 comments on commit 7117ac0

Please sign in to comment.