wip: zen
This commit is contained in:
parent
477586835a
commit
a11a608760
9 changed files with 1488 additions and 32 deletions
|
|
@ -12,13 +12,14 @@ export namespace Workspace {
|
|||
export const create = fn(z.void(), async () => {
|
||||
const account = Actor.assert("account")
|
||||
const workspaceID = Identifier.create("workspace")
|
||||
const userID = Identifier.create("user")
|
||||
await Database.transaction(async (tx) => {
|
||||
await tx.insert(WorkspaceTable).values({
|
||||
id: workspaceID,
|
||||
})
|
||||
await tx.insert(UserTable).values({
|
||||
workspaceID,
|
||||
id: Identifier.create("user"),
|
||||
id: userID,
|
||||
accountID: account.properties.accountID,
|
||||
name: "",
|
||||
role: "admin",
|
||||
|
|
@ -30,9 +31,10 @@ export namespace Workspace {
|
|||
})
|
||||
})
|
||||
await Actor.provide(
|
||||
"system",
|
||||
"user",
|
||||
{
|
||||
workspaceID,
|
||||
userID,
|
||||
},
|
||||
() => Key.create({ name: "Default API Key" }),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue