mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-03 09:34:48 +02:00
Merge branch 'main' of https://github.com/fosrl/pangolin
This commit is contained in:
commit
4cdaa9b588
22 changed files with 520 additions and 438 deletions
|
@ -100,15 +100,19 @@ export async function acceptInvite(
|
|||
);
|
||||
}
|
||||
|
||||
// add the user to the org
|
||||
await db.insert(userOrgs).values({
|
||||
userId: existingUser[0].userId,
|
||||
orgId: existingInvite.orgId,
|
||||
roleId: existingInvite.roleId
|
||||
});
|
||||
await db.transaction(async (trx) => {
|
||||
// add the user to the org
|
||||
await trx.insert(userOrgs).values({
|
||||
userId: existingUser[0].userId,
|
||||
orgId: existingInvite.orgId,
|
||||
roleId: existingInvite.roleId
|
||||
});
|
||||
|
||||
// delete the invite
|
||||
await db.delete(userInvites).where(eq(userInvites.inviteId, inviteId));
|
||||
// delete the invite
|
||||
await trx
|
||||
.delete(userInvites)
|
||||
.where(eq(userInvites.inviteId, inviteId));
|
||||
});
|
||||
|
||||
return response<AcceptInviteResponse>(res, {
|
||||
data: { accepted: true, orgId: existingInvite.orgId },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue