Skip to content

Commit

Permalink
Add validation for notification method
Browse files Browse the repository at this point in the history
  • Loading branch information
thongnguyen5 committed Apr 24, 2024
1 parent d77e8b4 commit 5ed711b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/apps/onebox/src/modules/monitor/dto/monitor.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class MonitorConditionDto {

export abstract class NotificationDto {
@ApiProperty({ type: MonitorNotificationMethod })
@IsNotEmpty()
method: MonitorNotificationMethod;

abstract toMonitorNotification(): MonitorNotification;
Expand Down Expand Up @@ -122,6 +123,7 @@ export class CreateMonitorDto {
},
})
@ValidateNested()
@IsNotEmpty()
@Type(() => NotificationDto, {
keepDiscriminatorProperty: true,
discriminator: {
Expand Down

0 comments on commit 5ed711b

Please sign in to comment.