🐛 Require non-empty title when duplicating (#807)

This commit is contained in:
Luke Vella 2023-08-09 10:16:46 +01:00 committed by GitHub
parent 996743caaf
commit 1c44b3954b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -65,7 +65,7 @@ export const polls = router({
create: possiblyPublicProcedure
.input(
z.object({
title: z.string(),
title: z.string().trim().min(1),
timeZone: z.string().optional(),
location: z.string().optional(),
description: z.string().optional(),
@ -794,7 +794,7 @@ export const polls = router({
.input(
z.object({
pollId: z.string(),
newTitle: z.string(),
newTitle: z.string().min(1),
}),
)
.mutation(async ({ input, ctx }) => {