need pagination-context for sortfields; only disable pagination-code on view

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-01-08 19:01:10 +01:00
parent 3b9c60e985
commit fb7d65d645

View File

@@ -203,15 +203,15 @@ class Pagination
public function getApiResponseParams(): array
{
return [
'pagination' => (Settings::Get('panel.paging') > 0) ? [
'pagination' => [
"total" => $this->entries,
"per_page" => $this->perPage,
"current_page" => $this->pageno,
"last_page" => ceil($this->entries / $this->perPage),
"last_page" => (Settings::Get('panel.paging') > 0) ? ceil($this->entries / $this->perPage) : -1,
"from" => $this->data['sql_offset'] ?? null,
"to" => min($this->data['sql_offset'] + $this->perPage, $this->entries),
'sortfields' => array_keys($this->fields),
] : []
]
];
}