-
Notifications
You must be signed in to change notification settings - Fork 12
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
WEG-11 TrainerTab Pagination #1962
Conversation
TehAwol
commented
Jun 9, 2024
- Add Pagination query for Game
- Simplify TrainerTab filters
public Page<Game> paginatedGames(@PathParam("status") final Game.Status status, | ||
@QueryParam("page") int page, | ||
@QueryParam("size") int size, | ||
@QueryParam("query") String query) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowed chars should be restricted, like:
@QueryParam("query") String query) { | |
@QueryParam("query")@Pattern(regexp = "^[\\p{L} .'-[0-9]]*$") String query) { |
Could you please add this to Usercontroller.paginatedUsers as well?
(regex to be tested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added issue in Jira as we need to check against GameModels and Games name regex
@@ -303,7 +300,7 @@ public void remove(final Game entity) { | |||
|
|||
// This is for retrocompatibility w/ game models that do not habe DebugGame | |||
if (entity.getGameModel().getGames().size() <= 1 | |||
&& !(entity.getGameModel().getGames().get(0) instanceof DebugGame)) {// This is for retrocompatibility w/ game models that do not habe DebugGame | |||
&& !(entity.getGameModel().getGames().get(0) instanceof DebugGame)) {// This is for retrocompatibility w/ game models that do not habe DebugGame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might throw out of bounds exception, do we care ?
* Get all games with given status paginated | ||
* | ||
*/ | ||
@GET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best would be to use a POST
List<Game.Status> gStatuses = new ArrayList<>(); | ||
gStatuses.add(status); | ||
|
||
Map<Long, List<String>> gMatrix = this.getPermissionMatrix(gStatuses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should paginate this as well to be future proof, if no time then create a story for improvement (3500 games in db), but make sur it will work for a while with prod db