mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-24 16:36:46 +00:00
26 lines
597 B
TypeScript
26 lines
597 B
TypeScript
import { getClient } from "../../client";
|
|
import { User } from "../user";
|
|
import { Workspace } from "../workspace";
|
|
|
|
export class Builder {
|
|
constructor(
|
|
public id: number,
|
|
public name: string,
|
|
public workspace: Workspace
|
|
) {}
|
|
}
|
|
|
|
export async function createBuilder(
|
|
builderName: string,
|
|
workspace: Workspace
|
|
): Promise<Builder> {
|
|
const response: any = await getClient(workspace.user).post(
|
|
`applications/workspace/${workspace.id}/`,
|
|
{
|
|
name: builderName,
|
|
type: "builder",
|
|
}
|
|
);
|
|
return new Builder(response.data.id, response.data.name, workspace);
|
|
}
|