fix: move user fetch
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user