fix
Desc: - Perubahan pengambilan data dari API ke Function use server No issue
This commit is contained in:
13
src/app/dev/profile/upload/[id]/layout.tsx
Normal file
13
src/app/dev/profile/upload/[id]/layout.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
|
||||
import { AppShell } from "@mantine/core";
|
||||
|
||||
export default function Layout({ children, params }: { children: any, params: {id: string} }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
<UploadFotoProfileLayout profileId={params.id}>{children}</UploadFotoProfileLayout>
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,23 +6,20 @@ 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 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)
|
||||
|
||||
const imageUrl = await funGetUserProfile(usr.id).then(
|
||||
(res) => res?.Profile?.ImageProfile?.url
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
<UploadFotoProfile imageUrl={imageUrl} />
|
||||
</>
|
||||
);
|
||||
@@ -1,10 +0,0 @@
|
||||
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
|
||||
import { AppShell } from "@mantine/core";
|
||||
|
||||
export default function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<UploadFotoProfileLayout>{children}</UploadFotoProfileLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user