Skip to content

Commit

Permalink
fix: protect the room name update to empty spaces (#176)
Browse files Browse the repository at this point in the history
fix: protect room name update to spaces
  • Loading branch information
romansharapov19 authored Sep 11, 2023
1 parent 8d9af40 commit a3035c5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/contract/rooms/update-room-settings.request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { z } from "zod";

export const UpdateRoomSettingsRequestSchema = z.object({
name: z.string().optional(),
name: z
.string()
.transform((value) => value.trim())
.refine((value) => value.length >= 3, {
message: "Name must have at least 3 characters",
})
.refine((value) => value.length <= 50, {
message: "Name must have at most 50 characters",
}),
isPrivate: z.boolean().optional(),
});

0 comments on commit a3035c5

Please sign in to comment.