Skip to content

Commit

Permalink
fix(web): workspace list is available only for workspace user
Browse files Browse the repository at this point in the history
  • Loading branch information
IKatsuba committed May 6, 2024
1 parent fb9f013 commit e7b1513
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/web/app/app/(dashboard)/[workspaceSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default async function Component({ params }: { params: { workspaceSlug: s

const { data: workspace } = await supabase
.from('workspaces')
.select('*')
.select('*, workspace_users(*)')
.eq('slug', params.workspaceSlug)
.eq('user_id', user.id)
.eq('workspace_users.user_id', user.id)
.single();

if (!workspace) {
Expand Down
5 changes: 4 additions & 1 deletion apps/web/app/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export default async function DashboardLayout({ children }: { children: ReactNod

const supabase = createAdminClient();

const { data: workspaces } = await supabase.from('workspaces').select('*').eq('user_id', user.id);
const { data: workspaces } = await supabase
.from('workspaces')
.select('*, workspace_users(*)')
.eq('workspace_users.user_id', user.id);

return (
<div>
Expand Down

0 comments on commit e7b1513

Please sign in to comment.