Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com> Co-authored-by: Omar López <zomars@me.com>
15 lines
412 B
TypeScript
15 lines
412 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() })).optional(),
|
|
value: z.string().optional(),
|
|
});
|
|
|
|
export const assignUserToAttributeSchema = z.object({
|
|
userId: z.number(),
|
|
attributes: attributeSchema.array(),
|
|
});
|
|
|
|
export type ZAssignUserToAttribute = z.infer<typeof assignUserToAttributeSchema>;
|