fix/secret-premade-event-hidden (#1999)

* fix/secret-premade-event-hidden

* fix/secret-premade-event-hidden: change hidden to partial in zod custom

Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
alannncandBailey Pumfleet authored and GitHub committed 2022-02-28 21:23:17 +00:00
1 parent 7826a34b00
commit 9851c8f526
1 file changed
+14 -12
+14 -12
View File
@@ -1,15 +1,17 @@
import { _EventTypeModel } from "../eventtype";
export const createEventTypeInput = _EventTypeModel
.pick({
title: true,
slug: true,
description: true,
length: true,
teamId: true,
schedulingType: true,
})
.refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {
path: ["schedulingType"],
message: "You must select a scheduling type for team events",
});
.pick({
title: true,
slug: true,
description: true,
length: true,
teamId: true,
schedulingType: true,
hidden: true,
})
.partial({ hidden: true })
.refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {
path: ["schedulingType"],
message: "You must select a scheduling type for team events",
});