* 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>
20 lines
537 B
TypeScript
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>;
|