Fix getAllByFieldPaginatedAndSorted query