-
-
Notifications
You must be signed in to change notification settings - Fork 117
feat(api): add offset and count parameters to API_GetGameList #2574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Overall I agree with this change. This is one of the few endpoints that at some point we should seriously consider introducing a breaking change into that forces users to paginate it. |
|
@wescopeland I'm playing with Eloquent and I got this code, instead of using $query = DB::table('GameData')
->where('ConsoleID', $consoleID);
if ($withAchievements) {
$query->whereExists(function ($query) {
$query
->from('Achievements')
->whereColumn('GameData.ID', 'Achievements.GameID');
});
}
if ($offset > 0 && $count > 0) {
$query
->offset($offset)
->limit($count);
}
$response = $query->get();In order to check if the game has Achievements, I'm using the foreign key from |
|
It's safe to assume |
|
@wescopeland So I took your advice and completely replaced the use of Hope you like my code 😅 |
|
All problems raised have beed fixed. Also added a new test when only |
Hi, in order to support pagination in any API client, I added a couple of params
offsetandcount.These are the same parameter used by
getGamesListByDevfunction, but the API endpoint wasn't support them.I added a test for these new parameters but despite working in reality, test is rising an error related to
SQL_CALC_FOUND_ROWSnot being supported.API Docs PR is here