fix
Desc: - Perubahan metode pengambilan data dari API ke use server
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import { UploadFotoProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<UploadFotoProfile />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KatalogLayout } from "@/app_modules/katalog/view";
|
||||
import { KatalogLayout } from "@/app_modules/katalog/main";
|
||||
|
||||
export default async function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { loadListPortofolio } from "@/app_modules/katalog/portofolio/fun/fun_get_all_portofolio";
|
||||
import { getProfile } from "@/app_modules/katalog/profile";
|
||||
import { KatalogView } from "@/app_modules/katalog/view";
|
||||
import { KatalogView } from "@/app_modules/katalog/main";
|
||||
import { url } from "inspector";
|
||||
import { unsealData } from "iron-session";
|
||||
import _, { get } from "lodash";
|
||||
import _ from "lodash";
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get_list_portofolio";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function Page() {
|
||||
const data = await getProfile();
|
||||
|
||||
|
||||
const u = cookies().get("ssn");
|
||||
const usr = JSON.parse(
|
||||
await unsealData(u?.value as string, {
|
||||
@@ -24,10 +24,11 @@ export default async function Page() {
|
||||
|
||||
const user = await funGetUserProfile(usr.id);
|
||||
|
||||
const listPorto = await funGetListPortofolio(user?.Profile?.id)
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* {JSON.stringify(data)} */}
|
||||
<KatalogView user={user as any} />
|
||||
<KatalogView user={user as any} listPorto={listPorto as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { CreatePortofolio } from "@/app_modules/katalog/portofolio";
|
||||
import { getBidangBisnis } from "@/app_modules/katalog/portofolio/api/get-bidang-bisnis";
|
||||
import { getBidangBisnis } from "@/app_modules/katalog/portofolio/fun/get_list_bidang_bisnis";
|
||||
import { getProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page() {
|
||||
@@ -10,7 +10,6 @@ export default async function Page() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{JSON.stringify(profileId)}
|
||||
<CreatePortofolio data={bidangBisnis} profileId={profileId} />
|
||||
</>
|
||||
);
|
||||
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