We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0a854c commit 9d21fcdCopy full SHA for 9d21fcd
src/services/message/message.dto.ts
@@ -4,6 +4,7 @@ import {
4
IsOptional,
5
IsObject,
6
ValidateNested,
7
+ ArrayMaxSize,
8
} from 'class-validator'
9
10
class MediaDto {
@@ -18,8 +19,9 @@ class MediaDto {
18
19
20
export class SendMessageDto {
21
@IsNotEmpty()
- @IsString()
22
- to: string
+ @IsString({ each: true }) // Validates each element of the array to be a string
23
+ @ArrayMaxSize(100) // Limit the array to a maximum of 100 elements
24
+ to: string[]
25
26
27
@IsString()
src/types/message/index.ts
@@ -7,7 +7,7 @@ export interface Media {
export interface ISendMessage {
api_key: string
+ to: string | string[]
11
from: string
12
sms: string
13
type: string
0 commit comments