fix: update board and workspace slug queries to filter by visibility

This commit is contained in:
Henry
2025-05-27 22:17:58 +01:00
parent b1bb8a6539
commit a0e2d45f74
2 changed files with 6 additions and 2 deletions

View File

@@ -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;

View File

@@ -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(