Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
el3ab-Player
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
el3ab-Player
Commits
d7626367
Commit
d7626367
authored
Jun 03, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: profile API uses select=* to avoid missing column errors
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
ed5f1c6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
profile.php
api/profile.php
+3
-2
No files found.
api/profile.php
View file @
d7626367
...
@@ -19,12 +19,13 @@ $method = $_SERVER['REQUEST_METHOD'];
...
@@ -19,12 +19,13 @@ $method = $_SERVER['REQUEST_METHOD'];
if
(
$method
===
'GET'
)
{
if
(
$method
===
'GET'
)
{
$targetId
=
$_GET
[
'id'
]
??
$userId
;
$targetId
=
$_GET
[
'id'
]
??
$userId
;
$db
=
supabase
(
$token
);
$db
=
supabase
(
$token
);
$profile
=
$db
->
getOne
(
'profiles'
,
[
'id'
=>
'eq.'
.
$targetId
,
'select'
=>
'id,username,display_name,display_name_ar,avatar_url,frame_id,border_color,level,xp,coins,gems,country_code,is_online,elo_bullet,elo_blitz,elo_rapid,elo_classical,games_played,games_won,games_lost,games_drawn,current_streak,best_streak,created_at'
]);
$profile
s
=
$db
->
get
(
'profiles'
,
[
'id'
=>
'eq.'
.
$targetId
,
'select'
=>
'*'
,
'limit'
=>
1
]);
if
(
!
$profile
||
isset
(
$profile
[
'error'
]
))
{
if
(
!
is_array
(
$profiles
)
||
isset
(
$profiles
[
'error'
])
||
empty
(
$profiles
))
{
jsonError
(
'Profile not found'
,
404
);
jsonError
(
'Profile not found'
,
404
);
}
}
$profile
=
$profiles
[
0
];
$ratings
=
$db
->
get
(
'player_game_ratings'
,
[
'player_id'
=>
'eq.'
.
$targetId
,
'select'
=>
'game_key,time_control,rating,games_played,wins,losses,draws'
]);
$ratings
=
$db
->
get
(
'player_game_ratings'
,
[
'player_id'
=>
'eq.'
.
$targetId
,
'select'
=>
'game_key,time_control,rating,games_played,wins,losses,draws'
]);
$profile
[
'ratings'
]
=
is_array
(
$ratings
)
&&
!
isset
(
$ratings
[
'error'
])
?
$ratings
:
[];
$profile
[
'ratings'
]
=
is_array
(
$ratings
)
&&
!
isset
(
$ratings
[
'error'
])
?
$ratings
:
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment