Added basic comments.
This commit is contained in:
@@ -2,7 +2,7 @@ import { RenderErrorPage } from 'vite-plugin-ssr/RenderErrorPage';
|
||||
import { fetchShelf } from '../../../src/shelves';
|
||||
import { fetchShelfPosts } from '../../../src/posts';
|
||||
|
||||
async function onBeforeRender(pageContext) {
|
||||
async function getPageData(pageContext) {
|
||||
const shelf = await fetchShelf(pageContext.routeParams.id);
|
||||
const posts = await fetchShelfPosts(pageContext.routeParams.id, { limit: 50 });
|
||||
|
||||
@@ -17,13 +17,9 @@ async function onBeforeRender(pageContext) {
|
||||
}
|
||||
|
||||
return {
|
||||
pageContext: {
|
||||
pageData: {
|
||||
shelf,
|
||||
posts,
|
||||
},
|
||||
},
|
||||
shelf,
|
||||
posts,
|
||||
};
|
||||
}
|
||||
|
||||
export { onBeforeRender };
|
||||
export { getPageData };
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<a
|
||||
href="/"
|
||||
class="link"
|
||||
>Go back home</a>
|
||||
|
||||
<h3>{{ shelf.slug }}</h3>
|
||||
|
||||
<ul class="posts nolist">
|
||||
|
||||
Reference in New Issue
Block a user