2
0

🚸 (publish) Improve invalid public ID feedback

Also remove the 4 char min length rule for self-hosted versions

Closes #267
This commit is contained in:
Baptiste Arnaud
2023-01-20 11:20:11 +01:00
parent fe2952d407
commit 0febaf9760
9 changed files with 68 additions and 29 deletions

View File

@ -62,9 +62,8 @@ export const getServerSideProps: GetServerSideProps = async (
const getTypebotFromPublicId = async (
publicId?: string
): Promise<TypebotPageProps['publishedTypebot'] | null> => {
if (!publicId) return null
const publishedTypebot = await prisma.publicTypebot.findFirst({
where: { typebot: { publicId } },
where: { typebot: { publicId: publicId ?? '' } },
include: {
typebot: { select: { name: true, isClosed: true, isArchived: true } },
},

View File

@ -52,9 +52,8 @@ export const getServerSideProps: GetServerSideProps = async (
const getTypebotFromPublicId = async (
publicId?: string
): Promise<TypebotPageV2Props['typebot'] | null> => {
if (!publicId) return null
const typebot = (await prisma.typebot.findUnique({
where: { publicId },
where: { publicId: publicId ?? '' },
select: {
theme: true,
name: true,