Enable admin user removals and invitation UX polish
This commit is contained in:
parent
aa12ebfe0a
commit
05f5af5ba6
5 changed files with 288 additions and 17 deletions
|
|
@ -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 }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue