mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-07 01:44:56 +01:00
wip: zen
This commit is contained in:
@@ -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" }),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user