mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-04 00:31:50 +02:00
CP UI pagination fix
This commit is contained in:
parent
367b9416eb
commit
9a962340b8
9 changed files with 40 additions and 31 deletions
|
@ -149,10 +149,11 @@
|
|||
},
|
||||
ajaxResponse: function(url, params, response) {
|
||||
if (response && Array.isArray(response.records) && typeof response.results === 'number') {
|
||||
var lastPage = Math.ceil(response.results / this.options.paginationSize);
|
||||
var pageSize = params.size || this.options.paginationSize;
|
||||
var lastPage = Math.ceil(response.results / pageSize);
|
||||
return {
|
||||
last_page: lastPage, // Calculated total number of pages
|
||||
data: response.records, // Data for the current page
|
||||
last_page: lastPage,
|
||||
data: response.records,
|
||||
};
|
||||
} else {
|
||||
console.error('Unexpected response format', response);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue