{{ shelf.slug }}
-
diff --git a/pages/shelf/create.page.vue b/pages/shelf/create.page.vue
index 53c7f8d..9b29689 100644
--- a/pages/shelf/create.page.vue
+++ b/pages/shelf/create.page.vue
@@ -137,7 +137,7 @@ const postAccess = ref('registered');
const isNsfw = ref(false);
async function create() {
- await post('/api/shelves', {
+ await post('/shelves', {
slug: slug.value,
title: title.value,
description: description.value,
diff --git a/renderer/_default.page.server.js b/renderer/_default.page.server.js
index e22d242..018d97a 100644
--- a/renderer/_default.page.server.js
+++ b/renderer/_default.page.server.js
@@ -12,7 +12,7 @@ async function render(pageContext) {
const title = (documentProps && documentProps.title) || 'shack';
const desc = (documentProps && documentProps.description) || 'Shack';
- const { app, store } = createApp(pageContext);
+ const { app } = createApp(pageContext);
const stream = renderToNodeStream(app);
const documentHtml = escapeInject`
@@ -38,14 +38,28 @@ async function render(pageContext) {
return {
documentHtml,
pageContext: {
- initialState: store.state.value,
+ // initialState: store.state.value,
enableEagerStreaming: true,
},
};
}
+async function onBeforeRender(pageContext) {
+ const pageData = await pageContext.exports.getPageData?.(pageContext, pageContext.session);
+
+ return {
+ pageContext: {
+ // initialState: store.state.value,
+ pageData,
+ user: pageContext.session.user,
+ now: new Date(),
+ },
+ };
+}
+
export {
render,
+ onBeforeRender,
};
-export const passToClient = ['urlPathname', 'initialState', 'pageData', 'pageProps', 'routeParams'];
+export const passToClient = ['urlPathname', 'initialState', 'pageData', 'pageProps', 'routeParams', 'user', 'now'];
diff --git a/renderer/container.vue b/renderer/container.vue
index cfc05d7..1233c0a 100644
--- a/renderer/container.vue
+++ b/renderer/container.vue
@@ -33,20 +33,13 @@
{{ comment.body }}
+