mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-29 14:50:13 -05:00
build modal initial
This commit is contained in:
@@ -4,10 +4,17 @@ import { weaponsWithHero } from "lib/lists/weaponsWithHero";
|
||||
import * as z from "zod";
|
||||
import { hasNoDuplicates } from "./common";
|
||||
|
||||
export const TITLE_CHARACTER_LIMIT = 100;
|
||||
export const DESCRIPTION_CHARACTER_LIMIT = 1000;
|
||||
|
||||
export const buildSchema = z.object({
|
||||
weapon: z.string().refine((val) => weaponsWithHero.includes(val as any)),
|
||||
title: z.string().max(100).optional().nullable(),
|
||||
description: z.string().max(1000).optional().nullable(),
|
||||
title: z.string().max(TITLE_CHARACTER_LIMIT).optional().nullable(),
|
||||
description: z
|
||||
.string()
|
||||
.max(DESCRIPTION_CHARACTER_LIMIT)
|
||||
.optional()
|
||||
.nullable(),
|
||||
modes: z
|
||||
.array(z.string())
|
||||
.min(1)
|
||||
|
||||
Reference in New Issue
Block a user