fix
Desc: - Perubahan pengambilan data dari API ke Function use server No issue
This commit is contained in:
@@ -6,6 +6,7 @@ import { redirect } from "next/navigation";
|
||||
|
||||
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() {
|
||||
@@ -18,9 +19,13 @@ export default async function Page() {
|
||||
})
|
||||
);
|
||||
|
||||
const dataProfile = await funGetUserProfile(usr.id)
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<HomeView user={usr} />
|
||||
{/* {JSON.stringify(usr)} */}
|
||||
<HomeView user={dataProfile as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
10
src/app/dev/katalog/[id]/layout.tsx
Normal file
10
src/app/dev/katalog/[id]/layout.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { KatalogLayout } from "@/app_modules/katalog/main";
|
||||
|
||||
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {
|
||||
// const a = atob(params.id.toString())
|
||||
return (
|
||||
<>
|
||||
<KatalogLayout profileId={params.id}>{children}</KatalogLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { KatalogLayout } from "@/app_modules/katalog/main";
|
||||
|
||||
export default async function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<KatalogLayout>{children}</KatalogLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
8
src/app/dev/portofolio/create/[id]/layout.tsx
Normal file
8
src/app/dev/portofolio/create/[id]/layout.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { CreatePortofolio, CreatePortofolioLayout, PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children, params}: {children: React.ReactNode, params: {id: string}}) {
|
||||
return<>
|
||||
<CreatePortofolioLayout profileId={params.id}>{children}</CreatePortofolioLayout>
|
||||
</>
|
||||
}
|
||||
16
src/app/dev/portofolio/create/[id]/page.tsx
Normal file
16
src/app/dev/portofolio/create/[id]/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { CreatePortofolio } from "@/app_modules/katalog/portofolio";
|
||||
import { getBidangBisnis } from "@/app_modules/katalog/portofolio/fun/get_bidang_bisnis";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const bidangBisnis = await getBidangBisnis();
|
||||
|
||||
return (
|
||||
<>
|
||||
<CreatePortofolio
|
||||
bidangBisnis={bidangBisnis as any}
|
||||
profileId={params.id}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
return<>
|
||||
<PortofolioLayout>{children}</PortofolioLayout>
|
||||
</>
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { CreatePortofolio } from "@/app_modules/katalog/portofolio";
|
||||
import { getBidangBisnis } from "@/app_modules/katalog/portofolio/fun/get_bidang_bisnis";
|
||||
import { getProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page() {
|
||||
const bidangBisnis = await getBidangBisnis()
|
||||
const id = await getProfile();
|
||||
const profileId = id?.id;
|
||||
// console.log(bidangBisnis)
|
||||
|
||||
return (
|
||||
<>
|
||||
<CreatePortofolio bidangBisnis={bidangBisnis as any} profileId={profileId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
||||
import { getOnePortofolio } from "@/app_modules/katalog/portofolio/fun/get_one_portofolio";
|
||||
|
||||
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {
|
||||
const getPorto = await getOnePortofolio(params.id)
|
||||
|
||||
|
||||
export default async function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<PortofolioLayout>{children}</PortofolioLayout>
|
||||
<PortofolioLayout profileId={getPorto?.profileId}>{children}</PortofolioLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,3 +7,4 @@ export default function Layout({ children }: { children: any }) {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
9
src/app/dev/profile/create/[id]/page.tsx
Normal file
9
src/app/dev/profile/create/[id]/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { CreateProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
// console.log(params.id)
|
||||
|
||||
return <>
|
||||
<CreateProfile userId={params.id}/>
|
||||
</>
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { CreateProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page() {
|
||||
return <>
|
||||
<CreateProfile/>
|
||||
</>
|
||||
}
|
||||
12
src/app/dev/profile/edit/[id]/layout.tsx
Normal file
12
src/app/dev/profile/edit/[id]/layout.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||
import { EditProfileLayout } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {
|
||||
const data = await funGetUserProfile(params.id)
|
||||
const profileId = data?.Profile?.id
|
||||
return (
|
||||
<>
|
||||
<EditProfileLayout profileId={profileId}>{children}</EditProfileLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/profile/edit/[id]/page.tsx
Normal file
14
src/app/dev/profile/edit/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||
import { getProfile } from "@/app_modules/katalog/profile";
|
||||
import EditProfile from "@/app_modules/katalog/profile/edit/view";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const data = await funGetUserProfile(params.id);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* {JSON.stringify(data)} */}
|
||||
<EditProfile data={data as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { EditProfileLayout } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default function Layout({ children }: { children: any }) {
|
||||
return (
|
||||
<>
|
||||
<EditProfileLayout>{children}</EditProfileLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
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