Files
calendar/packages/trpc/server/routers/viewer/attributes/edit.schema.ts
T
ee3c08918a feat: weights per attribute UI (#18109)
* wip attribut weights

* edit sheet and display in table

* add shrink so badges dont split

* push changes to support weights on csv export

* fix typing issue

* type error

* fall back to 100 weight

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
2024-12-12 11:54:10 +00:00

20 lines
537 B
TypeScript

import { z } from "zod";
export const editAttributeSchema = z.object({
attributeId: z.string(),
name: z.string(),
type: z.enum(["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"]),
isLocked: z.boolean().optional(),
isWeightsEnabled: z.boolean().optional(),
options: z.array(
z.object({
value: z.string(),
id: z.string().optional(),
isGroup: z.boolean().optional(),
contains: z.array(z.string()).optional(),
})
),
});
export type ZEditAttributeSchema = z.infer<typeof editAttributeSchema>;