Added basic actor page with scenes and co-star filtering.
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
import { fetchLatest, fetchUpcoming, fetchNew } from '#/src/scenes.js';
|
||||
|
||||
async function fetchScenes(scope, page, limit) {
|
||||
if (scope === 'new') {
|
||||
return fetchNew(page, { limit });
|
||||
}
|
||||
|
||||
if (scope === 'upcoming') {
|
||||
return fetchUpcoming(page, { limit });
|
||||
}
|
||||
|
||||
return fetchLatest(page, { limit });
|
||||
}
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const { scenes, limit, total } = await fetchScenes(pageContext.routeParams.scope, Number(pageContext.routeParams.page) || 1, Number(pageContext.urlParsed.search.limit) || 30);
|
||||
|
||||
// console.log(scenes);
|
||||
const { scenes, limit, total } = await fetchScenes({
|
||||
scope: pageContext.routeParams.scope || 'latest',
|
||||
}, {
|
||||
page: Number(pageContext.routeParams.page) || 1,
|
||||
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
||||
aggregate: false,
|
||||
});
|
||||
|
||||
return {
|
||||
pageContext: {
|
||||
|
||||
Reference in New Issue
Block a user