12 lines
351 B
TypeScript
12 lines
351 B
TypeScript
import { z } from "zod";
|
|
|
|
export const IngredientSchema = z.object({
|
|
id: z.number(),
|
|
name: z.string().nonempty(),
|
|
displayName: z.string().nonempty(),
|
|
displayNameDE: z.string().nonempty(),
|
|
});
|
|
|
|
export const IngredientSchemaWithoutId = IngredientSchema.omit({ id: true });
|
|
|
|
export type IngredientModel = z.infer<typeof IngredientSchema>; |