store last visited org in cookie

This commit is contained in:
miloschwartz 2025-06-24 14:54:07 -04:00
parent 34180ca454
commit 9bb4d8b2a3
No known key found for this signature in database
6 changed files with 14229 additions and 14065 deletions

View file

@ -180,7 +180,7 @@ export async function createOrg(
// Get all actions and create role actions
const actionIds = await trx.select().from(actions).execute();
if (actionIds.length > 0) {
await trx
.insert(roleActions)
@ -193,12 +193,14 @@ export async function createOrg(
);
}
await trx.insert(orgDomains).values(
allDomains.map((domain) => ({
orgId: newOrg[0].orgId,
domainId: domain.domainId
}))
);
if (allDomains.length) {
await trx.insert(orgDomains).values(
allDomains.map((domain) => ({
orgId: newOrg[0].orgId,
domainId: domain.domainId
}))
);
}
if (req.user) {
await trx.insert(userOrgs).values({