The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
validate project slug length
Steven Tey864ce69b7e5e
diff --git a/pages/api/projects/index.ts b/pages/api/projects/index.tsindex dbd76cb835..73fe09900a 100644--- a/pages/api/projects/index.ts+++ b/pages/api/projects/index.ts@@ -37,8 +37,12 @@ export default withUserAuth(}let slugError: string | null = null;- // check if slug is valid- if (!validSlugRegex.test(slug)) {+ // check if slug is too long+ if (slug.length > 48) {+ slugError = "Slug must be less than 48 characters";++ // check if slug is valid+ } else if (!validSlugRegex.test(slug)) {slugError = "Invalid slug";// check if slug is reserved