This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nextjs-auth0/utils/types.ts
2024-07-07 23:53:22 +02:00

27 lines
639 B
TypeScript

import { z } from 'zod';
export const CustomerFormCreateSchema = z.object({
type: z.string(),
text: z.string()
});
export type CustomerFormCreate = z.infer<typeof CustomerFormCreateSchema>;
export const CustomerFormSchema = z.object({
id: z.string(),
type: z.string(),
text: z.string(),
createdAt: z.string().transform(arg => new Date(arg)),
updatedAt: z.string().transform(arg => new Date(arg))
});
export const CustomerFormListSchema = z.array(CustomerFormSchema);
export type CustomerForm = z.infer<typeof CustomerFormSchema>;
export const ContextSchema = z.object({
params: z.object({
id: z.string()
})
});