From a0e2d45f74d5cdd5ab85852a46717d63e7ead9f5 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 27 May 2025 22:17:58 +0100 Subject: [PATCH] fix: update board and workspace slug queries to filter by visibility --- packages/db/src/repository/board.repo.ts | 6 +++++- packages/db/src/repository/workspace.repo.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/db/src/repository/board.repo.ts b/packages/db/src/repository/board.repo.ts index 1bdb8338..7df836f2 100644 --- a/packages/db/src/repository/board.repo.ts +++ b/packages/db/src/repository/board.repo.ts @@ -287,7 +287,11 @@ export const getBySlug = async ( orderBy: [asc(lists.index)], }, }, - where: and(eq(boards.slug, boardSlug), isNull(boards.deletedAt)), + where: and( + eq(boards.slug, boardSlug), + isNull(boards.deletedAt), + eq(boards.visibility, "public"), + ), }); if (!board) return null; diff --git a/packages/db/src/repository/workspace.repo.ts b/packages/db/src/repository/workspace.repo.ts index bb7eb888..6c3e66b7 100644 --- a/packages/db/src/repository/workspace.repo.ts +++ b/packages/db/src/repository/workspace.repo.ts @@ -145,7 +145,7 @@ export const getBySlugWithBoards = (db: dbClient, workspaceSlug: string) => { slug: true, name: true, }, - where: isNull(boards.deletedAt), + where: and(isNull(boards.deletedAt), eq(boards.visibility, "public")), }, }, where: and(