From 679757ccfa62590590a9e8b97da25f15fcce0eaa Mon Sep 17 00:00:00 2001 From: devlikepro Date: Sun, 11 Aug 2024 13:40:16 +0700 Subject: [PATCH] [core] check is array object fixes #470 --- src/structures/sessions.dto.ts | 2 ++ src/structures/webhooks.config.dto.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/structures/sessions.dto.ts b/src/structures/sessions.dto.ts index 66e4932a..e225bc06 100644 --- a/src/structures/sessions.dto.ts +++ b/src/structures/sessions.dto.ts @@ -2,6 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { BooleanString } from '@waha/nestjs/validation/BooleanString'; import { Transform, Type } from 'class-transformer'; import { + IsArray, IsBoolean, IsOptional, IsString, @@ -81,6 +82,7 @@ export class NowebConfig { export class SessionConfig { @ValidateNested({ each: true }) @Type(() => WebhookConfig) + @IsArray() @IsOptional() webhooks?: WebhookConfig[]; diff --git a/src/structures/webhooks.config.dto.ts b/src/structures/webhooks.config.dto.ts index cb5174fb..deb6cae7 100644 --- a/src/structures/webhooks.config.dto.ts +++ b/src/structures/webhooks.config.dto.ts @@ -89,6 +89,7 @@ export class WebhookConfig { }) @ValidateNested() @Type(() => CustomHeader) + @IsArray() @IsOptional() customHeaders?: CustomHeader[]; }