import z from "zod";
import type { OptionCategory } from "@prisma/client";
const options: OptionCategory[] = ["additional", "feature", "reason", "size"];
export const CreateProposalOptionValidator = z.object({
description: z
.string()
.min(5, { message: "Description must have at least 5 characters" })
.max(100, { message: "Description must have less than 100 characters" }),
// @ts-expect-error TODO: fix this, just a string atm
category: z.enum(options),
});
export type ProposalOptionCreateRequest = z.infer<
typeof CreateProposalOptionValidator
>;
import z from "zod";
import type { OptionCategory } from "@prisma/client";
const options: OptionCategory[] = ["additional", "feature", "reason", "size"];
export const CreateProposalOptionValidator = z.object({
description: z
.string()
.min(5, { message: "Description must have at least 5 characters" })
.max(100, { message: "Description must have less than 100 characters" }),
// @ts-expect-error TODO: fix this, just a string atm
category: z.enum(options),
});
export type ProposalOptionCreateRequest = z.infer<
typeof CreateProposalOptionValidator
>;