2
0

(customDomains) Fix custom domain update feedback

This commit is contained in:
Baptiste Arnaud
2023-08-21 15:32:27 +02:00
parent dc4c19a755
commit c08e0cdb0a
19 changed files with 506 additions and 104 deletions

View File

@ -0,0 +1,10 @@
import { CustomDomain as CustomDomainInDb } from '@typebot.io/prisma'
import { z } from 'zod'
const domainNameRegex = /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/
export const customDomainSchema = z.object({
name: z.string().refine((name) => domainNameRegex.test(name)),
workspaceId: z.string(),
createdAt: z.date(),
}) satisfies z.ZodType<CustomDomainInDb>