fix
Desc: - Perubahan metode pengambilan data dari API ke use server
This commit is contained in:
9
src/app/dev/profile/create/layout.tsx
Normal file
9
src/app/dev/profile/create/layout.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ProfileLayout } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<ProfileLayout>{children}</ProfileLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
7
src/app/dev/profile/create/page.tsx
Normal file
7
src/app/dev/profile/create/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { CreateProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page() {
|
||||
return <>
|
||||
<CreateProfile/>
|
||||
</>
|
||||
}
|
||||
9
src/app/dev/profile/edit/layout.tsx
Normal file
9
src/app/dev/profile/edit/layout.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { EditProfileLayout } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<EditProfileLayout>{children}</EditProfileLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/profile/edit/page.tsx
Normal file
13
src/app/dev/profile/edit/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getProfile } from "@/app_modules/katalog/profile";
|
||||
import EditProfile from "@/app_modules/katalog/profile/edit/view";
|
||||
|
||||
export default async function Page() {
|
||||
const data = await getProfile();
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* {JSON.stringify(data)} */}
|
||||
<EditProfile data={data} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
10
src/app/dev/profile/upload/layout.tsx
Normal file
10
src/app/dev/profile/upload/layout.tsx
Normal 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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
29
src/app/dev/profile/upload/page.tsx
Normal file
29
src/app/dev/profile/upload/page.tsx
Normal 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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user