fix: move user fetch

This commit is contained in:
Arvid Norlin
2024-04-25 14:35:48 +02:00
parent 840a20c4c1
commit 2ddcbff009
6 changed files with 12 additions and 14 deletions

View File

@@ -7,7 +7,6 @@ import styles from "./page.module.css"
import type { LangParams, PageArgs } from "@/types/params"
export default async function BenefitsPage({ params }: PageArgs<LangParams>) {
const user = await serverClient().user.get()
const accountPage = await serverClient().contentstack.accountPage.getBenefits(
{
lang: params.lang,
@@ -16,7 +15,7 @@ export default async function BenefitsPage({ params }: PageArgs<LangParams>) {
return (
<main className={styles.container}>
<Content user={user} lang={params.lang} content={accountPage.content} />
<Content lang={params.lang} content={accountPage.content} />
</main>
)
}

View File

@@ -1,15 +1,14 @@
import { _ } from "@/lib/translation"
import { serverClient } from "@/lib/trpc/server"
import Content from "@/components/MyPages/AccountPage/Content"
import MaxWidth from "@/components/MaxWidth"
import Content from "@/components/MyPages/AccountPage/Content"
import styles from "./page.module.css"
import type { LangParams, PageArgs } from "@/types/params"
export default async function MyPageOverview({ params }: PageArgs<LangParams>) {
const user = await serverClient().user.get()
const accountPage = await serverClient().contentstack.accountPage.getOverview(
{
lang: params.lang,
@@ -18,7 +17,7 @@ export default async function MyPageOverview({ params }: PageArgs<LangParams>) {
return (
<MaxWidth className={styles.blocks} tag="main">
<Content user={user} lang={params.lang} content={accountPage.content} />
<Content lang={params.lang} content={accountPage.content} />
</MaxWidth>
)
}