style: format code biome
This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
+14
-14
@@ -1,28 +1,28 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const createPollSchema = z.object({
|
||||
title: z.string().min(1, "Title is required").max(255),
|
||||
description: z.string().max(2000).nullable().optional(),
|
||||
status: z.enum(["draft", "active", "closed"]).default("draft"),
|
||||
showResults: z.coerce.number().int().min(0).max(1).default(1),
|
||||
multipleChoice: z.coerce.number().int().min(0).max(1).default(0),
|
||||
startsAt: z.coerce.date().nullable().optional(),
|
||||
endsAt: z.coerce.date().nullable().optional(),
|
||||
title: z.string().min(1, "Title is required").max(255),
|
||||
description: z.string().max(2000).nullable().optional(),
|
||||
status: z.enum(["draft", "active", "closed"]).default("draft"),
|
||||
showResults: z.coerce.number().int().min(0).max(1).default(1),
|
||||
multipleChoice: z.coerce.number().int().min(0).max(1).default(0),
|
||||
startsAt: z.coerce.date().nullable().optional(),
|
||||
endsAt: z.coerce.date().nullable().optional(),
|
||||
});
|
||||
|
||||
export const updatePollSchema = createPollSchema.partial();
|
||||
|
||||
export const pollQuestionSchema = z.object({
|
||||
pollId: z.coerce.number().int().positive(),
|
||||
question: z.string().min(1).max(500),
|
||||
type: z.enum(["single", "multiple", "text"]).default("single"),
|
||||
sortOrder: z.coerce.number().int().min(0).default(0),
|
||||
options: z.string().min(1, "Options are required"),
|
||||
pollId: z.coerce.number().int().positive(),
|
||||
question: z.string().min(1).max(500),
|
||||
type: z.enum(["single", "multiple", "text"]).default("single"),
|
||||
sortOrder: z.coerce.number().int().min(0).default(0),
|
||||
options: z.string().min(1, "Options are required"),
|
||||
});
|
||||
|
||||
export const pollVoteSchema = z.object({
|
||||
questionId: z.coerce.number().int().positive(),
|
||||
answer: z.string().min(1).max(500),
|
||||
questionId: z.coerce.number().int().positive(),
|
||||
answer: z.string().min(1).max(500),
|
||||
});
|
||||
|
||||
export type CreatePollInput = z.infer<typeof createPollSchema>;
|
||||
|
||||
Reference in new issue
Block a user