mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 06:46:40 +00:00
Working on auto registering gerbil
This commit is contained in:
@@ -9,6 +9,7 @@ import createHttpError from 'http-errors';
|
||||
import { ActionsEnum, checkUserActionPermission } from '@server/auth/actions';
|
||||
import logger from '@server/logger';
|
||||
import { createSuperuserRole } from '@server/db/ensureActions';
|
||||
import config, { APP_PATH } from "@server/config";
|
||||
|
||||
const createOrgSchema = z.object({
|
||||
orgId: z.string(),
|
||||
@@ -67,7 +68,7 @@ export async function createOrg(req: Request, res: Response, next: NextFunction)
|
||||
const newOrg = await db.insert(orgs).values({
|
||||
orgId,
|
||||
name,
|
||||
domain: ""
|
||||
domain: config.app.base_domain
|
||||
}).returning();
|
||||
|
||||
const roleId = await createSuperuserRole(newOrg[0].orgId);
|
||||
|
||||
Reference in New Issue
Block a user