Skip to content

Scheduling infrastructure for absolutely everyone.

fix: improve slug filtering to prevent same slug with diff case (#13074)

Riddhesh Mahajan8bb051ac4e89
diff --git a/apps/api/pages/api/teams/_post.ts b/apps/api/pages/api/teams/_post.ts
index 92588ecee66..f6f95cdc79a 100644
--- a/apps/api/pages/api/teams/_post.ts
+++ b/apps/api/pages/api/teams/_post.ts
@@ -88,7 +88,10 @@ async function postHandler(req: NextApiRequest) {
if (data.slug) {
const alreadyExist = await prisma.team.findFirst({
where: {
- slug: data.slug,
+ slug: {
+ mode: "insensitive",
+ equals: data.slug,
+ },
},
});
if (alreadyExist) throw new HttpError({ statusCode: 409, message: "Team slug already exists" });