traxxx-web/pages/users/@username/+onBeforeRender.js

15 lines
303 B
JavaScript
Raw Normal View History

2024-02-29 04:08:54 +00:00
import { fetchUser } from '#/src/users.js';
export async function onBeforeRender(pageContext) {
const profile = await fetchUser(pageContext.routeParams.username);
return {
pageContext: {
title: profile.username,
pageProps: {
profile, // differentiate from authed 'user'
},
},
};
}