Enable admin user removals and invitation UX polish

This commit is contained in:
Esdras Renan 2025-10-13 15:08:51 -03:00
parent aa12ebfe0a
commit 05f5af5ba6
5 changed files with 288 additions and 17 deletions

View file

@ -90,6 +90,17 @@ export const listAgents = query({
},
});
export const findByEmail = query({
args: { tenantId: v.string(), email: v.string() },
handler: async (ctx, { tenantId, email }) => {
const record = await ctx.db
.query("users")
.withIndex("by_tenant_email", (q) => q.eq("tenantId", tenantId).eq("email", email))
.first();
return record ?? null;
},
});
export const deleteUser = mutation({
args: { userId: v.id("users"), actorId: v.id("users") },
handler: async (ctx, { userId, actorId }) => {