admin entry actions
This commit is contained in:
@@ -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()
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user