mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 22:49:27 +02:00
Ensure the user's actions
This commit is contained in:
parent
c9b48a6123
commit
0eb55f7d02
9 changed files with 74 additions and 63 deletions
|
@ -8,42 +8,31 @@ import {
|
|||
targets,
|
||||
} from "@server/db/schema";
|
||||
import db from "@server/db";
|
||||
import { createSuperuserRole } from "@server/db/ensureActions";
|
||||
|
||||
async function insertDummyData() {
|
||||
// Insert dummy orgs
|
||||
const org1 = db
|
||||
.insert(orgs)
|
||||
.values({
|
||||
name: "Fossorial",
|
||||
domain: "localhost",
|
||||
})
|
||||
.returning()
|
||||
.get();
|
||||
|
||||
const org2 = db
|
||||
.insert(orgs)
|
||||
.values({
|
||||
name: "Fosrl",
|
||||
name: "Default",
|
||||
domain: "fosrl.io",
|
||||
})
|
||||
.returning()
|
||||
.get();
|
||||
|
||||
// Insert dummy users
|
||||
// await db.insert(users).values([
|
||||
// {
|
||||
// email: "john@fossorial.com",
|
||||
// groups: "admin,developer",
|
||||
// },
|
||||
// {
|
||||
// email: "jane@fossorial.com",
|
||||
// groups: "developer",
|
||||
// },
|
||||
// {
|
||||
// email: "bob@fosrl.io",
|
||||
// groups: "admin",
|
||||
// },
|
||||
// ]);
|
||||
await createSuperuserRole(org1.orgId);
|
||||
|
||||
const org2 = db
|
||||
.insert(orgs)
|
||||
.values({
|
||||
name: "Fossorial",
|
||||
domain: "fossorial.io",
|
||||
})
|
||||
.returning()
|
||||
.get();
|
||||
|
||||
await createSuperuserRole(org2.orgId);
|
||||
|
||||
// Insert dummy exit nodes
|
||||
const exitNode1 = db
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue