Skip to content

Commit 3569dbd

Browse files
author
arthosofteq
authored
Merge pull request #768 from RedisInsight/feature/RI-1453-pub-sub
fix publish dto
2 parents 3a4e626 + 4403bfb commit 3569dbd

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
2-
IsNotEmpty, IsString,
2+
IsDefined,
3+
IsString,
34
} from 'class-validator';
45
import { ApiProperty } from '@nestjs/swagger';
56

@@ -9,7 +10,7 @@ export class PublishDto {
910
description: 'Message to send',
1011
example: '{"hello":"world"}',
1112
})
12-
@IsNotEmpty()
13+
@IsDefined()
1314
@IsString()
1415
message: string;
1516

@@ -18,7 +19,7 @@ export class PublishDto {
1819
description: 'Chanel name',
1920
example: 'channel-1',
2021
})
21-
@IsNotEmpty()
22+
@IsDefined()
2223
@IsString()
2324
channel: string;
2425
}

redisinsight/api/test/api/pub-sub/POST-instance-id-pub-sub-messages.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ const endpoint = (instanceId = constants.TEST_INSTANCE_ID) =>
1616
request(server).post(`/instance/${instanceId}/pub-sub/messages`);
1717

1818
const dataSchema = Joi.object({
19-
channel: Joi.string().required(),
20-
message: Joi.string().required(),
21-
}).messages({
22-
'any.required': '{#label} should not be empty',
19+
channel: Joi.string().allow('').required(),
20+
message: Joi.string().allow('').required(),
2321
}).strict();
2422

2523
const validInputData = {

0 commit comments

Comments
 (0)