feat: add Account Page query
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { _ } from "@/lib/translation"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { request } from "@/lib/graphql/request"
|
||||
import { GetAccountPage } from "@/lib/graphql/Query/AccountPage.graphql"
|
||||
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||
@@ -8,10 +10,32 @@ import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import { GetAccountPageData } from "@/types/requests/myPages/accountpage"
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function MyPageOverview({ params }: PageArgs<LangParams>) {
|
||||
const user = await serverClient().user.get()
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
const response = await request<GetAccountPageData>(
|
||||
GetAccountPage,
|
||||
{
|
||||
locale: params.lang,
|
||||
url: "/my-pages/overview",
|
||||
},
|
||||
{
|
||||
tags: [`'/my-pages/overview',-en`],
|
||||
}
|
||||
)
|
||||
|
||||
if (!response.data?.all_account_page?.total) {
|
||||
console.log("#### DATA ####")
|
||||
console.log(response.data)
|
||||
throw new Error("Not found")
|
||||
}
|
||||
|
||||
const pageData = response.data.all_account_page.items[0]
|
||||
>>>>>>> 13b5550 (feat: add Account Page query)
|
||||
|
||||
return (
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
|
||||
Reference in New Issue
Block a user