Files
calendar/packages/trpc/server/routers/viewer/attributes/assignUserToAttribute.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

17 lines
453 B
TypeScript

import { z } from "zod";
const attributeSchema = z.object({
id: z.string(),
options: z
.array(z.object({ label: z.string().optional(), value: z.string(), weight: z.number().optional() }))
.optional(),
value: z.string().optional(),
});
export const assignUserToAttributeSchema = z.object({
userId: z.number(),
attributes: attributeSchema.array(),
});
export type ZAssignUserToAttribute = z.infer<typeof assignUserToAttributeSchema>;