fix
Desc: - Perubahan pengambilan data dari API ke Function use server No issue
This commit is contained in:
26
src/app/dev/profile/upload/[id]/page.tsx
Normal file
26
src/app/dev/profile/upload/[id]/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
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,
|
||||
})
|
||||
);
|
||||
|
||||
const imageUrl = await funGetUserProfile(usr.id).then(
|
||||
(res) => res?.Profile?.ImageProfile?.url
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<UploadFotoProfile imageUrl={imageUrl} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user