Openstatus www.openstatus.dev

hotfix: clerk webhook

mxkaske 200db5ab a285bace

+3 -1
+3 -1
packages/api/src/router/clerk/webhook.ts
··· 1 1 import * as z from "zod"; 2 2 3 + import { eq } from "@openstatus/db"; 3 4 import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema"; 4 5 5 6 import { createTRPCRouter, publicProcedure } from "../../trpc"; ··· 17 18 // There's no primary key with drizzle I checked the tennant is not already in the database 18 19 const alreadyExists = await opts.ctx.db 19 20 .select({ id: user.id }) 20 - .from(user); 21 + .from(user) 22 + .where(eq(user.tenantId, opts.input.data.data.id)); 21 23 22 24 if (alreadyExists.length) return; 23 25