Retrieves the previous page of query results.
The prev()
function retrieves the previous page of query results.
The page size is defined by the limit()
function, can be retrieved using the pageSize
property, and
navigating through pages is done with the prev()
and
next()
functions.
If items are added or removed between calls to prev()
the values returned
may change.
function prev(): Promise<ResourceCatalogQueryResult>;
oldResults
.prev()
.then((results) => {
const newResults = results;
const items = newResults.items;
const firstItem = items[0];
const totalCount = newResults.totalCount;
const pageSize = newResults.pageSize;
const currentPage = newResults.currentPage;
const totalPages = newResults.totalPages;
const hasNext = newResults.hasNext();
const hasPrev = newResults.hasPrev();
const length = newResults.length;
const query = newResults.query;
})
.catch((error) => {
console.error(error);
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.