Desc:
- Perubahan metode pengambilan data dari API ke use server
This commit is contained in:
2023-10-09 17:08:16 +08:00
parent ca66c3d2d8
commit 2b0ecc7bef
29 changed files with 87 additions and 128 deletions

View File

@@ -0,0 +1,10 @@
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
import { AppShell } from "@mantine/core";
export default function Layout({ children }: { children: any }) {
return (
<>
<UploadFotoProfileLayout>{children}</UploadFotoProfileLayout>
</>
);
}

View File

@@ -0,0 +1,29 @@
import { UploadFotoProfile } from "@/app_modules/katalog/profile";
import { unsealData } from "iron-session";
import { cookies } from "next/headers";
import yaml from "yaml";
import fs from "fs";
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function Page() {
const c = cookies().get("ssn")
const usr = JSON.parse(
await unsealData(c?.value as string, {
password: config.server.password,
})
);
console.log(usr)
const imageUrl = await funGetUserProfile(usr.id).then((res) => res?.Profile?.ImageProfile?.url)
return (
<>
<UploadFotoProfile imageUrl={imageUrl} />
</>
);
}