feat: workspace description
This commit is contained in:
@@ -42,13 +42,21 @@ export const create = async (
|
||||
export const update = async (
|
||||
db: SupabaseClient<Database>,
|
||||
workspacePublicId: string,
|
||||
name: string | undefined,
|
||||
slug: string | undefined,
|
||||
plan?: "free" | "pro" | "enterprise",
|
||||
workspaceInput: {
|
||||
name?: string;
|
||||
slug?: string;
|
||||
plan?: "free" | "pro" | "enterprise";
|
||||
description?: string;
|
||||
},
|
||||
) => {
|
||||
const { data } = await db
|
||||
.from("workspace")
|
||||
.update({ name, slug, plan })
|
||||
.update({
|
||||
name: workspaceInput.name,
|
||||
slug: workspaceInput.slug,
|
||||
plan: workspaceInput.plan,
|
||||
description: workspaceInput.description,
|
||||
})
|
||||
.eq("publicId", workspacePublicId)
|
||||
.is("deletedAt", null);
|
||||
|
||||
@@ -111,6 +119,7 @@ export const getBySlugWithBoards = async (
|
||||
`
|
||||
publicId,
|
||||
name,
|
||||
description,
|
||||
slug,
|
||||
boards: board (
|
||||
publicId,
|
||||
@@ -139,6 +148,7 @@ export const getAllByUserId = async (
|
||||
workspace (
|
||||
publicId,
|
||||
name,
|
||||
description,
|
||||
slug,
|
||||
plan
|
||||
)
|
||||
|
||||
@@ -293,6 +293,7 @@ export const workspaces = pgTable("workspace", {
|
||||
id: bigserial("id", { mode: "number" }).primaryKey(),
|
||||
publicId: varchar("publicId", { length: 12 }).notNull().unique(),
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
description: text("description"),
|
||||
slug: varchar("slug", { length: 255 }).notNull().unique(),
|
||||
plan: workspacePlanEnum("plan").notNull().default("free"),
|
||||
createdBy: uuid("createdBy")
|
||||
|
||||
@@ -582,6 +582,7 @@ export type Database = {
|
||||
createdBy: string
|
||||
deletedAt: string | null
|
||||
deletedBy: string | null
|
||||
description: string | null
|
||||
id: number
|
||||
name: string
|
||||
plan: Database["public"]["Enums"]["workspace_plan"]
|
||||
@@ -594,6 +595,7 @@ export type Database = {
|
||||
createdBy: string
|
||||
deletedAt?: string | null
|
||||
deletedBy?: string | null
|
||||
description?: string | null
|
||||
id?: number
|
||||
name: string
|
||||
plan?: Database["public"]["Enums"]["workspace_plan"]
|
||||
@@ -606,6 +608,7 @@ export type Database = {
|
||||
createdBy?: string
|
||||
deletedAt?: string | null
|
||||
deletedBy?: string | null
|
||||
description?: string | null
|
||||
id?: number
|
||||
name?: string
|
||||
plan?: Database["public"]["Enums"]["workspace_plan"]
|
||||
|
||||
Reference in New Issue
Block a user