Added basic actor page with scenes and co-star filtering.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<div>
|
||||
<Scenes
|
||||
:scenes="scenes"
|
||||
:show-filters="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -9,7 +10,7 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Scenes from '../../components/scenes/scenes.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
|
||||
const { pageProps } = inject('pageContext');
|
||||
const { scenes } = pageProps;
|
||||
|
||||
@@ -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