mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-05 02:24:59 +02:00
Ensure the user's actions
This commit is contained in:
parent
143a3b756e
commit
4fc630cf42
9 changed files with 74 additions and 63 deletions
|
@ -7,6 +7,7 @@ import HttpCode from '@server/types/HttpCode';
|
|||
import createHttpError from 'http-errors';
|
||||
import { ActionsEnum, checkUserActionPermission } from '@server/auth/actions';
|
||||
import logger from '@server/logger';
|
||||
import { createSuperuserRole } from '@server/db/ensureActions';
|
||||
|
||||
const createOrgSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
|
@ -50,6 +51,8 @@ export async function createOrg(req: Request, res: Response, next: NextFunction)
|
|||
domain,
|
||||
}).returning();
|
||||
|
||||
await createSuperuserRole(newOrg[0].orgId);
|
||||
|
||||
return response(res, {
|
||||
data: newOrg[0],
|
||||
success: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue