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 <pumfleet@hey.com>
pull/2007/head
alannnc 2022-02-28 14:23:17 -07:00 committed by GitHub
parent 7826a34b00
commit 9851c8f526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

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",
});