feat: attempt to fix the crud with auth

This commit is contained in:
Riccardo
2024-07-07 17:47:57 +02:00
parent ea73368cc9
commit 637520dbf2
27 changed files with 622 additions and 53 deletions

6
utils/cn.ts Normal file
View File

@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

24
utils/types.ts Normal file
View File

@@ -0,0 +1,24 @@
import { z } from 'zod';
export const UserSchema = z.object({
id: z.string(),
name: z.string(),
email: z.string().email(),
deleted: z.boolean(),
createdAt: z.date().transform(date => date.toISOString()),
updatedAt: z.date().transform(date => date.toISOString())
});
export type User = z.infer<typeof UserSchema>;
export const CustomerFormSchema = z.object({
id: z.string(),
type: z.string(),
text: z.string(),
createdAt: z.date().transform(date => date.toISOString()),
updatedAt: z.date().transform(date => date.toISOString())
});
export const CustomerFormListSchema = z.array(CustomerFormSchema);
export type CustomerForm = z.infer<typeof CustomerFormSchema>;