Circular dependecy hotfix
parent
e5b6a3332e
commit
a0709fac88
|
@ -1,15 +1,18 @@
|
|||
import { _EventTypeModel } from "../eventtype";
|
||||
import { SchedulingType } from "@prisma/client";
|
||||
import { z } from "zod";
|
||||
import * as imports from "../../zod-utils";
|
||||
// TODO: figure out why EventTypeModel is being called even if it's not imported here, causing a circular dependency
|
||||
// import { _EventTypeModel } from "../eventtype";
|
||||
|
||||
export const createEventTypeInput = _EventTypeModel
|
||||
.pick({
|
||||
title: true,
|
||||
slug: true,
|
||||
description: true,
|
||||
length: true,
|
||||
teamId: true,
|
||||
schedulingType: true,
|
||||
hidden: true,
|
||||
locations: true
|
||||
export const createEventTypeInput = z.object({
|
||||
title: z.string().min(1),
|
||||
slug: imports.eventTypeSlug,
|
||||
description: z.string().nullish(),
|
||||
length: z.number().int(),
|
||||
hidden: z.boolean(),
|
||||
teamId: z.number().int().nullish(),
|
||||
schedulingType: z.nativeEnum(SchedulingType).nullish(),
|
||||
locations: imports.eventTypeLocations,
|
||||
})
|
||||
.partial({ hidden: true, locations: true })
|
||||
.refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {
|
||||
|
|
Loading…
Reference in New Issue