Merge pull request #3736 from okriuchykhin/ok_SCI_6348

Improve performance of repository cells index in the API [SCI-6348]
This commit is contained in:
Miha Mencin 2021-12-13 15:44:33 +01:00 committed by GitHub
commit 381be79f10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ module Api
def index
cells = @inventory_item.repository_cells
.preload(value: @inventory.cell_preload_includes)
.preload(:repository_column, value: @inventory.cell_preload_includes)
.page(params.dig(:page, :number))
.per(params.dig(:page, :size))
render jsonapi: cells, each_serializer: InventoryCellSerializer