fix: improve slug filtering to prevent same slug with diff case (#13074)
This commit is contained in:
1 parent
fd3fffd7dd
commit
8bb051ac4e
1 file changed
+4
-1
@@ -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" });
|
||||
|
||||
Reference in new issue
Block a user