fix: remove validateSlug Query (#8015)
* fix: remove validateSlug Query Signed-off-by: Udit Takkar <[email protected]> * chore Signed-off-by: Udit Takkar <[email protected]> --------- Signed-off-by: Udit Takkar <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
99dba73d0b
commit
73afb03308
2 files changed
+25
-43
No files matched your search
@@ -85,13 +85,13 @@ export const viewerTeamsRouter = router({
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const { slug, name, logo } = input;
|
||||
|
||||
const nameCollisions = await ctx.prisma.team.findFirst({
|
||||
const slugCollisions = await ctx.prisma.team.findFirst({
|
||||
where: {
|
||||
slug: slug,
|
||||
},
|
||||
});
|
||||
|
||||
if (nameCollisions) throw new TRPCError({ code: "BAD_REQUEST", message: "Team name already taken." });
|
||||
if (slugCollisions) throw new TRPCError({ code: "BAD_REQUEST", message: "team_url_taken" });
|
||||
|
||||
// Ensure that the user is not duplicating a requested team
|
||||
const duplicatedRequest = await ctx.prisma.team.findFirst({
|
||||
@@ -587,21 +587,6 @@ export const viewerTeamsRouter = router({
|
||||
},
|
||||
});
|
||||
}),
|
||||
validateTeamSlug: authedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
slug: z.string(),
|
||||
})
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const team = await ctx.prisma.team.findFirst({
|
||||
where: {
|
||||
slug: input.slug,
|
||||
},
|
||||
});
|
||||
|
||||
return !team;
|
||||
}),
|
||||
publish: authedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
|
||||
Reference in new issue
Block a user