Customise pagination for resource in adminjs/ admin bro

1k Views Asked by At

I am new to admin bro/ adminjs, I am looking to modify pagination for a resource. I did see the example here

https://adminjs.co/Pagination.html

and tried, but I am missing how to configure it with resource. Can anyone point me to full example or how to configure the pagination for a resource.

1

There are 1 best solutions below

0
On

In source code perPage parameter get from query. So, you must set for every request.

actions: {
    list: {
        before: async (request, context) => {
            request.query.perPage = 1;
            return request
        }
    }
}