fix: Update check for user existence

This commit is contained in:
Thomas Camlong
2024-05-10 14:24:35 +02:00
parent c2026d0962
commit 65025a5dda

View File

@@ -35,8 +35,7 @@ export const userRouter = createTRPCRouter({
const user = await ctx.db.query.users.findFirst({
where: eq(users.name, input.username),
});
if (user !== null) {
if (user !== undefined) {
throw new TRPCError({
code: "FORBIDDEN",
message: "User already exists",