Add ability to get, post, and delete for other users if admin
This commit is contained in:
1 parent
95fc04a453
commit
a5413b40ab
2 files changed
+15
-5
No files matched your search
@@ -5,10 +5,16 @@ import { _ScheduleModel as Schedule } from "@calcom/prisma/zod";
|
||||
const schemaScheduleBaseBodyParams = Schedule.omit({ id: true }).partial();
|
||||
|
||||
const schemaScheduleRequiredParams = z.object({
|
||||
userId: z.number().optional(),
|
||||
name: z.string(),
|
||||
});
|
||||
|
||||
export const schemaScheduleBodyParams = schemaScheduleBaseBodyParams.merge(schemaScheduleRequiredParams);
|
||||
|
||||
export const schemaSchedulePublic = Schedule.omit({});
|
||||
export const schemaSchedulePublic = z
|
||||
.object({ id: z.number() })
|
||||
.merge(Schedule)
|
||||
.merge(
|
||||
z.object({
|
||||
availability: z.array(z.object({ id: z.number() })).optional(),
|
||||
})
|
||||
);
|
||||
Reference in new issue
Block a user