mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
[SCI-5631] Add ordering to index endpoint so pagination works, limit maximum page size for kaminari
This commit is contained in:
parent
c0ff2865b5
commit
961fa9ab4e
2 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ module Api
|
|||
.preload(repository_cells: @inventory.cell_preload_includes)
|
||||
.page(params.dig(:page, :number))
|
||||
.per(params.dig(:page, :size))
|
||||
.order(:id)
|
||||
render jsonapi: items, each_serializer: InventoryItemSerializer, include: include_params
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Kaminari.configure do |config|
|
||||
config.default_per_page = 10
|
||||
# config.max_per_page = nil
|
||||
config.max_per_page = 100
|
||||
# config.window = 4
|
||||
# config.outer_window = 0
|
||||
# config.left = 0
|
||||
|
|
Loading…
Add table
Reference in a new issue