Fix resource new id number

This commit is contained in:
Owen Schwartz
2024-10-26 12:15:03 -04:00
parent c6d4c4db20
commit 261b3c7e31
19 changed files with 31 additions and 28 deletions

View File

@@ -65,10 +65,13 @@ export async function createOrg(req: Request, res: Response, next: NextFunction)
);
}
// create a url from config.app.base_url and get the hostname
const domain = new URL(config.app.base_url).hostname;
const newOrg = await db.insert(orgs).values({
orgId,
name,
domain: config.app.base_domain
domain
}).returning();
const roleId = await createSuperuserRole(newOrg[0].orgId);