Fix URL by removing slash and backslash (#1733)

* Fix URl by removing slash and backslash

* Implement slugify

* Add data type

* Fixing folder structure

* Solve zod-utils conflict
This commit is contained in:
Juan Esteban Nieto Cifuentes authored and GitHub committed 2022-02-21 09:53:16 -07:00
1 parent 95b3397e42
commit 7585e9b32e
3 files changed
+90 -84

No files matched your search

+3 -2
View File
@@ -1,11 +1,12 @@
import { z } from "zod";
import { LocationType } from "@calcom/lib/location";
import { LocationType } from "@lib/location";
import { slugify } from "@lib/slugify";
export const eventTypeLocations = z.array(
z.object({ type: z.nativeEnum(LocationType), address: z.string().optional() })
);
export const eventTypeSlug = z.string().transform((val) => val.trim());
export const eventTypeSlug = z.string().transform((val) => slugify(val.trim()));
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()]);