Skip to content

Commit

Permalink
fix(dashboard): update feedback message for minimum length requirement (
Browse files Browse the repository at this point in the history
#2281)

Update Zod schema to specify that feedback must contain at least 20 characters.
  • Loading branch information
unrenamed authored Oct 9, 2024
1 parent b01d946 commit b68e117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/components/dashboard/feedback-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Feedback: React.FC<FeedbackProps> = ({ variant, FeedbackOpen }) =>
const schema = z.object({
severity: z.enum(["p0", "p1", "p2", "p3"]),
issueType: z.enum(["bug", "feature", "security", "payment", "question"]),
message: z.string(),
message: z.string().min(20, 'Feedback must contain at least 20 characters'),
});

const form = useForm<z.infer<typeof schema>>({
Expand Down
4 changes: 3 additions & 1 deletion apps/dashboard/lib/trpc/routers/plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export const createPlainIssue = rateLimitedProcedure(ratelimit.create)
z.object({
issueType,
severity,
message: z.string(),
message: z
.string()
.min(20, 'Feedback must contain at least 20 characters'),
}),
)
.mutation(async ({ input, ctx }) => {
Expand Down

0 comments on commit b68e117

Please sign in to comment.