Added boob and country aggregation to actors page.

This commit is contained in:
2023-12-31 03:02:03 +01:00
parent b5a730764c
commit 6408365933
276 changed files with 37792 additions and 166 deletions

View File

@@ -1,15 +1,15 @@
import { fetchActors } from '#/src/actors.js';
import { curateActorsQuery } from '#/src/web/actors.js';
export async function onBeforeRender(pageContext) {
const query = pageContext.urlParsed.search;
console.log(pageContext);
const { actors, limit, total } = await fetchActors({
query: query.q,
requireAvatar: Object.hasOwn(query, 'avatar'),
age: query.age?.split(',').map((age) => Number(age)),
height: query.height?.split(',').map((height) => Number(height)),
weight: query.weight?.split(',').map((weight) => Number(weight)),
}, {
const {
actors,
countries,
limit,
total,
} = await fetchActors(curateActorsQuery(pageContext.urlQuery), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 50,
});
@@ -19,6 +19,7 @@ export async function onBeforeRender(pageContext) {
title: 'actors',
pageProps: {
actors,
countries,
limit,
total,
},