Skip to content

Commit

Permalink
keep query-parameters when changing page size
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Dec 20, 2023
1 parent ba3f8f9 commit 4426af7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin
## [unreleased]

- add `tags` to all routes
- fix `collections` and `items` HTML templates to keep query-parameters when changing the `page size`

## [0.5.6] - 2023-12-19

Expand Down
4 changes: 3 additions & 1 deletion tipg/templates/collections.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ <h1>Collections</h1>
<script>
function changePageSize() {
var url = "{{ template.api_root }}/collections?";
url += "limit=" + $("#limit").val();
const searchParams = new URLSearchParams(window.location.search);
searchParams.set('limit', $("#limit").val());
url += searchParams.toString();
window.location.href = url;
}
$(function() {
Expand Down
6 changes: 4 additions & 2 deletions tipg/templates/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ <h1>Collection Items: {{ response.title or response.id }}</h1>
</div>

<script>
var currentURL = "{{ template.api_root }}/collections/{{ response.id }}/items"
var currentURL = "{{ template.api_root }}/collections/{{ response.id }}/items"
function changePageSize() {
var url = "{{ template.api_root }}/collections/{{ response.id }}/items?";
url += "limit=" + $("#limit").val();
const searchParams = new URLSearchParams(window.location.search);
searchParams.set('limit', $("#limit").val());
url += searchParams.toString();
window.location.href = url;
}
$(function() {
Expand Down

1 comment on commit 4426af7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TiPg Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 4426af7 Previous: ba3f8f9 Ratio
tests/benchmarks.py::test_benchmark_tile[0/0/0-WebMercatorQuad] 2.5752518225538297 iter/sec (stddev: 0.6452432532422236) 6.76114485397551 iter/sec (stddev: 0.00595289132548328) 2.63

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.