fix/cant-create-team-name-taken (#5911)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/5913/head
parent
cc9b49131e
commit
c3122c82e4
|
@ -85,7 +85,9 @@ export const viewerTeamsRouter = router({
|
|||
const { slug, name, logo } = input;
|
||||
|
||||
const nameCollisions = await ctx.prisma.team.findFirst({
|
||||
where: { OR: [{ name }, { slug }] },
|
||||
where: {
|
||||
slug: slug,
|
||||
},
|
||||
});
|
||||
|
||||
if (nameCollisions) throw new TRPCError({ code: "BAD_REQUEST", message: "Team name already taken." });
|
||||
|
|
Loading…
Reference in New Issue