feat: attempt to fix the crud with auth
This commit is contained in:
6
utils/cn.ts
Normal file
6
utils/cn.ts
Normal 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
24
utils/types.ts
Normal 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>;
|
||||
Reference in New Issue
Block a user