API/PayloadResponseOptions
PayloadResponseOptions
src/models/response-options.tsclass
Pre-configured ResponseOptions for the Payload CMS driver
The envelope is the flat mongoose-paginate-v2 shape: { docs, totalDocs, limit, totalPages, page, pagingCounter, hasPrevPage, hasNextPage, prevPage, nextPage }. pagingCounter is the 1-indexed
offset of the first doc on the page and maps onto from; to has no
body field and is derived. prevPage/nextPage are page numbers,
not URLs, so the navigation-URL paths default to empty strings. All
paths are overridable via PaginationConfig (dot notation
supported) for custom wrappers.
Constructor
Section titled “Constructor”new PayloadResponseOptions(options: PaginationConfig)| Parameter | Type | Description |
|---|---|---|
options |
PaginationConfig |
— |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
currentPage |
string |
— |
data |
string |
— |
firstPageUrl |
string |
— |
from |
string |
— |
lastPage |
string |
— |
lastPageUrl |
string |
— |
nextPageUrl |
string |
— |
path |
string |
— |
perPage |
string |
— |
prevPageUrl |
string |
— |
to |
string |
— |
total |
string |
— |
