From ac01cc72697a6bef8115609036b0a45b814f84aa Mon Sep 17 00:00:00 2001 From: abdou6666 Date: Mon, 3 Feb 2025 18:02:42 +0100 Subject: [PATCH] fix: apply feedback naming --- api/src/chat/schemas/types/channel.ts | 4 ++-- api/src/chat/validation-rules/is-channel-data.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/chat/schemas/types/channel.ts b/api/src/chat/schemas/types/channel.ts index bdb1ffdb..13de7204 100644 --- a/api/src/chat/schemas/types/channel.ts +++ b/api/src/chat/schemas/types/channel.ts @@ -20,8 +20,8 @@ export type SubscriberChannelData = [P in keyof SubscriberChannelDict[C]]: SubscriberChannelDict[C][P]; }; -export const channelSchema = z.object({ +export const channelDataSchema = z.object({ name: z.string().regex(/-channel$/) as z.ZodType, }); -export type Channel = z.infer; +export type Channel = z.infer; diff --git a/api/src/chat/validation-rules/is-channel-data.ts b/api/src/chat/validation-rules/is-channel-data.ts index ef1590ff..5bb6082e 100644 --- a/api/src/chat/validation-rules/is-channel-data.ts +++ b/api/src/chat/validation-rules/is-channel-data.ts @@ -13,10 +13,10 @@ import { ValidatorConstraintInterface, } from 'class-validator'; -import { Channel, channelSchema } from '../schemas/types/channel'; +import { Channel, channelDataSchema } from '../schemas/types/channel'; export function isChannelData(channel: Channel) { - return channelSchema.safeParse(channel).success; + return channelDataSchema.safeParse(channel).success; } @ValidatorConstraint({ async: false })