feat: public workspace

This commit is contained in:
Henry
2025-01-04 18:25:05 +00:00
parent 34cabb5f16
commit f1b0860734
4 changed files with 151 additions and 0 deletions

View File

@@ -101,6 +101,32 @@ export const getByPublicIdWithMembers = async (
return data;
};
export const getBySlugWithBoards = async (
db: SupabaseClient<Database>,
workspaceSlug: string,
) => {
const { data } = await db
.from("workspace")
.select(
`
publicId,
name,
slug,
boards: board (
publicId,
name
)
`,
)
.eq("slug", workspaceSlug)
.is("deletedAt", null)
.is("boards.deletedAt", null)
.limit(1)
.single();
return data;
};
export const getAllByUserId = async (
db: SupabaseClient<Database>,
userId: string,