admin entry actions

This commit is contained in:
2025-06-10 16:51:03 +02:00
parent 0aab9f55d7
commit 6a9c78c209
44 changed files with 5555 additions and 1038 deletions

View File

@@ -3,9 +3,28 @@ import { createInsertSchema, createUpdateSchema, createSelectSchema} from 'drizz
import { z } from "zod";
export const selectSchema = createSelectSchema(cvEntry);
export const insertSchema = createInsertSchema(cvEntry);
export const inserSchemaNoDates = insertSchema.omit({
fromTime:true,
toTime:true
})
export const insertSchemaForm = inserSchemaNoDates.merge(z.object({
fromTime: z.date(),
toTime: z.date()
}))
export const updateSchema = createUpdateSchema(cvEntry);
export const updateSchemaNoDates = updateSchema.omit({
fromTime:true,
toTime:true
})
export const getSchema = selectSchema.pick({id: true});
export const updateRouteSchema = z.object({
by: selectSchema.pick({id:true}),
update: updateSchema
})
update: updateSchema.omit({id:true})
})
export const updateRouteSchemaCliennt = z.object({
by: selectSchema.pick({id:true}),
update: updateSchemaNoDates.merge(z.object({
fromTime: z.date(),
toTime: z.date()
}))
})