parent
487a4153e4
commit
b2bc6500a3
|
@ -8,7 +8,7 @@ import {
|
||||||
_EventTypeModel,
|
_EventTypeModel,
|
||||||
} from "@calcom/prisma/zod";
|
} from "@calcom/prisma/zod";
|
||||||
import { stringOrNumber } from "@calcom/prisma/zod-utils";
|
import { stringOrNumber } from "@calcom/prisma/zod-utils";
|
||||||
import { createEventTypeInput } from "@calcom/prisma/zod-utils";
|
import { createEventTypeInput } from "@calcom/prisma/zod/eventtypeCustom";
|
||||||
|
|
||||||
import { createProtectedRouter } from "@server/createRouter";
|
import { createProtectedRouter } from "@server/createRouter";
|
||||||
import { viewerRouter } from "@server/routers/viewer";
|
import { viewerRouter } from "@server/routers/viewer";
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"pre-commit": "lint-staged",
|
"pre-commit": "lint-staged",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"postinstall": "yarn workspace @calcom/prisma generate-schemas",
|
|
||||||
"start": "turbo run start --scope=\"@calcom/web\"",
|
"start": "turbo run start --scope=\"@calcom/web\"",
|
||||||
"test": "turbo run test",
|
"test": "turbo run test",
|
||||||
"test-playwright": "yarn playwright test",
|
"test-playwright": "yarn playwright test",
|
||||||
|
|
|
@ -3,8 +3,6 @@ import { z } from "zod";
|
||||||
import { LocationType } from "@calcom/lib/location";
|
import { LocationType } from "@calcom/lib/location";
|
||||||
import { slugify } from "@calcom/lib/slugify";
|
import { slugify } from "@calcom/lib/slugify";
|
||||||
|
|
||||||
import { _EventTypeModel } from "./zod/eventtype";
|
|
||||||
|
|
||||||
export const eventTypeLocations = z.array(
|
export const eventTypeLocations = z.array(
|
||||||
z.object({ type: z.nativeEnum(LocationType), address: z.string().optional() })
|
z.object({ type: z.nativeEnum(LocationType), address: z.string().optional() })
|
||||||
);
|
);
|
||||||
|
@ -12,19 +10,3 @@ export const eventTypeLocations = z.array(
|
||||||
export const eventTypeSlug = z.string().transform((val) => slugify(val.trim()));
|
export const eventTypeSlug = z.string().transform((val) => slugify(val.trim()));
|
||||||
export const stringToDate = z.string().transform((a) => new Date(a));
|
export const stringToDate = z.string().transform((a) => new Date(a));
|
||||||
export const stringOrNumber = z.union([z.string().transform((v) => parseInt(v, 10)), z.number().int()]);
|
export const stringOrNumber = z.union([z.string().transform((v) => parseInt(v, 10)), z.number().int()]);
|
||||||
|
|
||||||
const createEventTypeBaseInput = _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",
|
|
||||||
});
|
|
||||||
|
|
||||||
export const createEventTypeInput = createEventTypeBaseInput;
|
|
||||||
|
|
|
@ -54,9 +54,6 @@
|
||||||
],
|
],
|
||||||
"outputs": [".next/**"]
|
"outputs": [".next/**"]
|
||||||
},
|
},
|
||||||
"@calcom/web#dev": {
|
|
||||||
"dependsOn": ["@calcom/prisma#build"]
|
|
||||||
},
|
|
||||||
"@calcom/web#dx": {
|
"@calcom/web#dx": {
|
||||||
"dependsOn": ["@calcom/prisma#dx"]
|
"dependsOn": ["@calcom/prisma#dx"]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue