Commit 8338a9e1 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: use service role for org memberships/applications queries (RLS)

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent c9556fdf
...@@ -203,7 +203,7 @@ if ($method === 'POST') { ...@@ -203,7 +203,7 @@ if ($method === 'POST') {
} }
if ($action === 'my-memberships') { if ($action === 'my-memberships') {
$db = supabase($token); $db = supabaseService();
$memberships = $db->get('org_memberships', [ $memberships = $db->get('org_memberships', [
'user_id' => 'eq.' . $userId, 'user_id' => 'eq.' . $userId,
'select' => 'id,organization_id,role,status,joined_at,organizations(id,name,slug,logo_url)' 'select' => 'id,organization_id,role,status,joined_at,organizations(id,name,slug,logo_url)'
...@@ -213,7 +213,7 @@ if ($method === 'POST') { ...@@ -213,7 +213,7 @@ if ($method === 'POST') {
} }
if ($action === 'my-applications') { if ($action === 'my-applications') {
$db = supabase($token); $db = supabaseService();
$apps = $db->get('org_membership_applications', [ $apps = $db->get('org_membership_applications', [
'player_id' => 'eq.' . $userId, 'player_id' => 'eq.' . $userId,
'select' => 'id,org_id,status,document_type,notes,rejection_reason,created_at,organizations(id,name,slug,logo_url)', 'select' => 'id,org_id,status,document_type,notes,rejection_reason,created_at,organizations(id,name,slug,logo_url)',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment