Added pagination and total to revisions.
This commit is contained in:
@@ -10,10 +10,12 @@ export async function onBeforeRender(pageContext) {
|
||||
|
||||
const {
|
||||
revisions,
|
||||
total: revisionTotal,
|
||||
avatars,
|
||||
} = await fetchActorRevisions(null, {
|
||||
isFinalized: false,
|
||||
limit: 50,
|
||||
isFinalized: Object.hasOwn(pageContext.urlParsed.search, 'final'),
|
||||
limit: Number(pageContext.urlParsed.search.limit) || 100,
|
||||
page: Number(pageContext.routeParams.page) || 1,
|
||||
}, pageContext.user);
|
||||
|
||||
return {
|
||||
@@ -21,6 +23,7 @@ export async function onBeforeRender(pageContext) {
|
||||
title: pageContext.routeParams.section,
|
||||
pageProps: {
|
||||
revisions,
|
||||
revisionTotal,
|
||||
avatars,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { match } from 'path-to-regexp';
|
||||
|
||||
const path = '/admin/:section/:domain(actors)';
|
||||
const path = '/admin/:section/:domain(actors)/:page?';
|
||||
const urlMatch = match(path, { decode: decodeURIComponent });
|
||||
|
||||
export default (pageContext) => {
|
||||
@@ -11,6 +11,8 @@ export default (pageContext) => {
|
||||
routeParams: {
|
||||
section: matched.params.section,
|
||||
domain: matched.params.domain,
|
||||
page: matched.params.page || '1',
|
||||
path,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user