diff --git a/public/img/2eef80a1-f811-4769-980a-63bfe97e1a6e.webp b/public/img/2eef80a1-f811-4769-980a-63bfe97e1a6e.webp
new file mode 100644
index 00000000..e0c75142
Binary files /dev/null and b/public/img/2eef80a1-f811-4769-980a-63bfe97e1a6e.webp differ
diff --git a/public/img/68adba2f-db46-4074-82ea-7d2ea5f5bd35.png b/public/img/68adba2f-db46-4074-82ea-7d2ea5f5bd35.png
new file mode 100644
index 00000000..b4ef2a39
Binary files /dev/null and b/public/img/68adba2f-db46-4074-82ea-7d2ea5f5bd35.png differ
diff --git a/public/img/77a5d35a-5bc0-46ca-857d-c4008c3a2f44.png b/public/img/77a5d35a-5bc0-46ca-857d-c4008c3a2f44.png
new file mode 100644
index 00000000..d0c9754c
Binary files /dev/null and b/public/img/77a5d35a-5bc0-46ca-857d-c4008c3a2f44.png differ
diff --git a/public/img/f8e8f088-441a-4b7c-b081-7c2695399c09.jpeg b/public/img/f8e8f088-441a-4b7c-b081-7c2695399c09.jpeg
new file mode 100644
index 00000000..66e914cb
Binary files /dev/null and b/public/img/f8e8f088-441a-4b7c-b081-7c2695399c09.jpeg differ
diff --git a/src/app/api/auth/validasi/route.ts b/src/app/api/auth/validasi/route.ts
index 98d57f05..ba849d0e 100644
--- a/src/app/api/auth/validasi/route.ts
+++ b/src/app/api/auth/validasi/route.ts
@@ -6,6 +6,7 @@ import { sealData, unsealData } from "iron-session";
import { getConfig } from "@/bin/config";
import yaml from "yaml";
import fs from "fs";
+import { revalidatePath } from "next/cache";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function POST(req: Request) {
@@ -47,6 +48,8 @@ export async function POST(req: Request) {
maxAge: 60 * 60 * 24 * 7,
});
+ revalidatePath("/dev/home")
+
return NextResponse.json({ status: 200, data });
}
diff --git a/src/app/dev/home/page.tsx b/src/app/dev/home/page.tsx
index ce7a8440..98c88a72 100644
--- a/src/app/dev/home/page.tsx
+++ b/src/app/dev/home/page.tsx
@@ -4,22 +4,23 @@ import { unsealData } from "iron-session";
import _ from "lodash";
import { redirect } from "next/navigation";
+import yaml from "yaml";
+import fs from "fs";
+const config = yaml.parse(fs.readFileSync("config.yaml").toString());
+
export default async function Page() {
const c = cookies().get("ssn");
- // const tkn = !c
- // ? null
- // : JSON.parse(
- // await unsealData(c.value as string, {
- // password: process.env.PWD as string,
- // })
- // );
- // if (!c?.value) return redirect("/dev/auth/login");
+ if (!c?.value) return redirect("/dev/auth/login");
+ const usr = JSON.parse(
+ await unsealData(c?.value as string, {
+ password: config.server.password,
+ })
+ );
return (
<>
- {/* {JSON.stringify(tkn)} */}
-
+
>
);
}
diff --git a/src/app/dev/katalog/profile/upload/page.tsx b/src/app/dev/katalog/profile/upload/page.tsx
deleted file mode 100644
index 66ced2af..00000000
--- a/src/app/dev/katalog/profile/upload/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { UploadFotoProfile } from "@/app_modules/katalog/profile";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/katalog/view/layout.tsx b/src/app/dev/katalog/view/layout.tsx
index 034b9257..903dc27c 100644
--- a/src/app/dev/katalog/view/layout.tsx
+++ b/src/app/dev/katalog/view/layout.tsx
@@ -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 (
diff --git a/src/app/dev/katalog/view/page.tsx b/src/app/dev/katalog/view/page.tsx
index 7d34f1a6..6ed3a573 100644
--- a/src/app/dev/katalog/view/page.tsx
+++ b/src/app/dev/katalog/view/page.tsx
@@ -1,14 +1,34 @@
-import { loadListPortofolio } from "@/app_modules/katalog/portofolio/fun/fun_get_all_portofolio";
+import prisma from "@/app/lib/prisma";
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 _ 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 listPorto = await loadListPortofolio(data?.id as string)
+
+ const u = cookies().get("ssn");
+ const usr = JSON.parse(
+ await unsealData(u?.value as string, {
+ password: config.server.password,
+ })
+ );
+
+ const user = await funGetUserProfile(usr.id);
+
+ const listPorto = await funGetListPortofolio(user?.Profile?.id)
+
return (
<>
- {/* {JSON.stringify(data)} */}
-
+
>
);
}
diff --git a/src/app/dev/katalog/portofolio/create/layout.tsx b/src/app/dev/portofolio/create/layout.tsx
similarity index 100%
rename from src/app/dev/katalog/portofolio/create/layout.tsx
rename to src/app/dev/portofolio/create/layout.tsx
diff --git a/src/app/dev/katalog/portofolio/create/page.tsx b/src/app/dev/portofolio/create/page.tsx
similarity index 89%
rename from src/app/dev/katalog/portofolio/create/page.tsx
rename to src/app/dev/portofolio/create/page.tsx
index a8badd70..92d01ad6 100644
--- a/src/app/dev/katalog/portofolio/create/page.tsx
+++ b/src/app/dev/portofolio/create/page.tsx
@@ -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)}
>
);
diff --git a/src/app/dev/katalog/profile/create/layout.tsx b/src/app/dev/profile/create/layout.tsx
similarity index 100%
rename from src/app/dev/katalog/profile/create/layout.tsx
rename to src/app/dev/profile/create/layout.tsx
diff --git a/src/app/dev/katalog/profile/create/page.tsx b/src/app/dev/profile/create/page.tsx
similarity index 100%
rename from src/app/dev/katalog/profile/create/page.tsx
rename to src/app/dev/profile/create/page.tsx
diff --git a/src/app/dev/katalog/profile/edit/layout.tsx b/src/app/dev/profile/edit/layout.tsx
similarity index 100%
rename from src/app/dev/katalog/profile/edit/layout.tsx
rename to src/app/dev/profile/edit/layout.tsx
diff --git a/src/app/dev/katalog/profile/edit/page.tsx b/src/app/dev/profile/edit/page.tsx
similarity index 100%
rename from src/app/dev/katalog/profile/edit/page.tsx
rename to src/app/dev/profile/edit/page.tsx
diff --git a/src/app/dev/katalog/profile/upload/layout.tsx b/src/app/dev/profile/upload/layout.tsx
similarity index 100%
rename from src/app/dev/katalog/profile/upload/layout.tsx
rename to src/app/dev/profile/upload/layout.tsx
diff --git a/src/app/dev/profile/upload/page.tsx b/src/app/dev/profile/upload/page.tsx
new file mode 100644
index 00000000..fd388ea7
--- /dev/null
+++ b/src/app/dev/profile/upload/page.tsx
@@ -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 (
+ <>
+
+
+ >
+ );
+}
diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx
index ff5b02db..f3ac68da 100644
--- a/src/app_modules/auth/validasi/view.tsx
+++ b/src/app_modules/auth/validasi/view.tsx
@@ -18,6 +18,7 @@ import { IconCircleLetterH } from "@tabler/icons-react";
import toast from "react-simple-toasts";
import { ApiHipmi } from "@/app/lib/api";
import { useRouter } from "next/navigation";
+import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
export default function Validasi() {
const router = useRouter();
@@ -48,7 +49,8 @@ export default function Validasi() {
myConsole(val);
if (val.status == 200) {
toast("Berhasil Login");
- return router.push("/dev/home");
+ setTimeout(() => router.push("/dev/home"), 2000);
+ funGetUserProfile(val.data.id);
} else {
toast("Silahkan Registrasi");
return router.push("/dev/auth/register");
diff --git a/src/app_modules/fun/get_user_profile.ts b/src/app_modules/fun/get_user_profile.ts
new file mode 100644
index 00000000..efcc3ebe
--- /dev/null
+++ b/src/app_modules/fun/get_user_profile.ts
@@ -0,0 +1,35 @@
+"use server";
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function funGetUserProfile(userId: string) {
+ const user = await prisma.user.findUnique({
+ where: {
+ id: userId,
+ },
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: {
+ select: {
+ id: true,
+ alamat: true,
+ email: true,
+ jenisKelamin: true,
+ name: true,
+ ImageProfile: {
+ select: {
+ url: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ revalidatePath("/dev/home");
+ revalidatePath("/dev/katalog/view")
+
+ return user;
+}
diff --git a/src/app_modules/home/view.tsx b/src/app_modules/home/view.tsx
index c44594b9..d2ebc483 100644
--- a/src/app_modules/home/view.tsx
+++ b/src/app_modules/home/view.tsx
@@ -40,11 +40,11 @@ import {
gs_fotoProfile,
gs_profile,
} from "../katalog/profile/state/global_state";
-import { loadListPortofolio } from "../katalog/portofolio/fun/fun_get_all_portofolio";
import { gs_ListPortofolio } from "../katalog/portofolio/state/global_state";
import { myConsole } from "@/app/fun/my_console";
import { getFotoProfile } from "../katalog/profile/api/get-foto-profile";
-import getListPortofolio from "../katalog/portofolio/api/get-portofolio";
+import { funGetUserProfile } from "../fun/get_user_profile";
+import { USER_PROFILE } from "../models/user_profile";
const listHalaman = [
{
@@ -89,64 +89,44 @@ const listHalaman = [
},
];
-export default function HomeView() {
+// export const dynamic = "force-dynamic"
+// export const revalidate = 0
+
+export default function HomeView({ user }: { user: USER_PROFILE }) {
const router = useRouter();
+ const [stateUser, setStateUser] = useState(user);
- const [token, setToken] = useAtom(gs_token);
- useShallowEffect(() => {
- getUserId();
- }, []);
- async function getUserId() {
- const get = await getToken();
- if(!get) return myConsole("Data Kosong")
- setToken(get);
- }
-
- const [profile, setProfile] = useAtom(gs_profile);
- useShallowEffect(() => {
- loadProfile();
- }, []);
- async function loadProfile() {
- const get = await getProfile();
- if(!get) return myConsole("Data Kosong")
- setProfile(get);
- }
-
- const [foto, setFoto] = useAtom(gs_fotoProfile);
- useShallowEffect(() => {
- getFoto(profile?.imagesId);
- }, [profile?.imagesId]);
-
- async function getFoto(id: string) {
- if(id === undefined){
- return myConsole("Waiting data")
- } else {
- const data = await getFotoProfile(id);
- setFoto(data?.url);
- }
- }
-
- // const [listPorto, setListPorto] = useAtom(gs_ListPortofolio);
+ // const [token, setToken] = useAtom(gs_token);
// useShallowEffect(() => {
- // getListPorto(profile?.id);
- // }, [profile?.id]);
- // async function getListPorto(id: string) {
- // const data = await getListPortofolio(id);
- // setListPorto(data);
+ // getUserId();
+ // }, []);
+ // async function getUserId() {
+ // const get = await getToken();
+ // if (!get) return myConsole("Data Kosong");
+ // setToken(get);
+ // }
+
+ // const [profile, setProfile] = useAtom(gs_profile);
+ // useShallowEffect(() => {
+ // loadProfile();
+ // }, []);
+ // async function loadProfile() {
+ // const get = await getProfile();
+ // if (!get) return myConsole("Data Kosong");
+ // setProfile(get);
// }
return (
<>
- {/*
{JSON.stringify(foto, null, 2)} */}
-
+ {/* */}
{
- if (profile === null) {
- return router.push("/dev/katalog/profile/create");
+ if (stateUser.Profile === null) {
+ return router.push("/dev/profile/create");
} else {
return router.push("/dev/katalog/view");
}
@@ -156,13 +136,17 @@ export default function HomeView() {
- Welcome to I,{" "}
- {token?.username ? token?.username : }
+ Welcome to ,{" "}
+ {stateUser.username ? stateUser.username : }
+
+
+ {/* {JSON.stringify(stateUser, null, 2)} */}
+
{listHalaman.map((e, i) => (
diff --git a/src/app_modules/katalog/view/index.ts b/src/app_modules/katalog/main/index.ts
similarity index 100%
rename from src/app_modules/katalog/view/index.ts
rename to src/app_modules/katalog/main/index.ts
diff --git a/src/app_modules/katalog/view/layout.tsx b/src/app_modules/katalog/main/layout.tsx
similarity index 96%
rename from src/app_modules/katalog/view/layout.tsx
rename to src/app_modules/katalog/main/layout.tsx
index a4477690..d82a233f 100644
--- a/src/app_modules/katalog/view/layout.tsx
+++ b/src/app_modules/katalog/main/layout.tsx
@@ -25,7 +25,7 @@ export default function KatalogLayout({ children }: { children: any }) {
Katalog
- router.push("/dev/katalog/portofolio/create")}>
+ router.push("/dev/portofolio/create")}>
{/* */}
diff --git a/src/app_modules/katalog/view/view.tsx b/src/app_modules/katalog/main/view.tsx
similarity index 67%
rename from src/app_modules/katalog/view/view.tsx
rename to src/app_modules/katalog/main/view.tsx
index 36fd5ff1..b9b8236c 100644
--- a/src/app_modules/katalog/view/view.tsx
+++ b/src/app_modules/katalog/main/view.tsx
@@ -32,14 +32,16 @@ import { useAtom } from "jotai";
import { loadDataProfile } from "../profile/fun/fun_get_profile";
import { getFotoProfile } from "../profile/api/get-foto-profile";
import { ApiHipmi } from "@/app/lib/api";
-import { PortofolioView } from "../portofolio";
+import { ListPortofolioView } from "../portofolio";
+import { User } from "@prisma/client";
+import { USER_PROFILE } from "@/app_modules/models/user_profile";
+import { LIST_PORTOFOLIO } from "@/app_modules/models/portofolio";
-export default function KatalogView({ data, porto }: { data: any, porto: any }) {
+export default function KatalogView({ user, listPorto }: { user: USER_PROFILE, listPorto: LIST_PORTOFOLIO }) {
return (
<>
-
-
-
+
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/create/view.tsx b/src/app_modules/katalog/portofolio/create/view.tsx
index 0ff7a01d..f8863e4b 100644
--- a/src/app_modules/katalog/portofolio/create/view.tsx
+++ b/src/app_modules/katalog/portofolio/create/view.tsx
@@ -58,7 +58,7 @@ export default function CreatePortofolio({
return (
<>
- {/* {JSON.stringify(data)} */}
+
res);
- return data
- }
-}
diff --git a/src/app_modules/katalog/portofolio/api/get-bidang-bisnis.ts b/src/app_modules/katalog/portofolio/fun/get_list_bidang_bisnis.ts
similarity index 100%
rename from src/app_modules/katalog/portofolio/api/get-bidang-bisnis.ts
rename to src/app_modules/katalog/portofolio/fun/get_list_bidang_bisnis.ts
diff --git a/src/app_modules/katalog/portofolio/api/get-portofolio.ts b/src/app_modules/katalog/portofolio/fun/get_list_portofolio.ts
similarity index 50%
rename from src/app_modules/katalog/portofolio/api/get-portofolio.ts
rename to src/app_modules/katalog/portofolio/fun/get_list_portofolio.ts
index 59ec8f6e..fa5a000f 100644
--- a/src/app_modules/katalog/portofolio/api/get-portofolio.ts
+++ b/src/app_modules/katalog/portofolio/fun/get_list_portofolio.ts
@@ -1,19 +1,11 @@
"use server";
-import { myConsole } from "@/app/fun/my_console";
import prisma from "@/app/lib/prisma";
-/**
- *
- * @param id - profileId
- * @returns list portofolio by Id
- */
-export default async function getListPortofolio(id: string) {
- // myConsole(id);
-
+export async function funGetListPortofolio(profileId: any) {
const data = await prisma.katalog.findMany({
where: {
- profileId: id,
+ profileId: profileId,
},
select: {
id: true,
@@ -21,14 +13,10 @@ export default async function getListPortofolio(id: string) {
alamatKantor: true,
tlpn: true,
deskripssi: true,
- active: true,
masterBidangBisnisId: true,
+ active: true,
},
});
- if (!data) {
- throw new Error("Failed to fetch data");
- }
-
- return data;
+ return data
}
diff --git a/src/app_modules/katalog/portofolio/index.ts b/src/app_modules/katalog/portofolio/index.ts
index 3496c641..3c257e8b 100644
--- a/src/app_modules/katalog/portofolio/index.ts
+++ b/src/app_modules/katalog/portofolio/index.ts
@@ -1,5 +1,5 @@
import CreatePortofolio from "./create/view";
import PortofolioLayout from "./create/layout";
-import PortofolioView from "./list_view/view";
+import ListPortofolioView from "./list_view/view";
-export {CreatePortofolio, PortofolioLayout, PortofolioView}
\ No newline at end of file
+export {CreatePortofolio, PortofolioLayout, ListPortofolioView}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/list_view/view.tsx b/src/app_modules/katalog/portofolio/list_view/view.tsx
index fec26322..d838b565 100644
--- a/src/app_modules/katalog/portofolio/list_view/view.tsx
+++ b/src/app_modules/katalog/portofolio/list_view/view.tsx
@@ -2,48 +2,37 @@
import { Box, Center, Grid, Paper, Text, Title } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useState } from "react";
-import { loadListPortofolio } from "../fun/fun_get_all_portofolio";
import _ from "lodash";
import { IconCaretRightFilled } from "@tabler/icons-react";
import { loadDataProfile } from "../../profile/fun/fun_get_profile";
import { useAtom } from "jotai";
import { gs_profile } from "../../profile/state/global_state";
-import getListPortofolio from "../api/get-portofolio";
import { gs_ListPortofolio } from "../state/global_state";
+import { myConsole } from "@/app/fun/my_console";
+import { getProfile } from "../../profile";
+import { LIST_PORTOFOLIO } from "@/app_modules/models/portofolio";
-export default function PortofolioView({
- profileId,
- porto,
+export default function ListPortofolioView({
+ listPorto,
}: {
- profileId: any;
- porto: any;
+ listPorto: LIST_PORTOFOLIO;
}) {
- const [profile, setProfile] = useAtom(gs_profile);
- useShallowEffect(() => {
- loadDataProfile(setProfile);
- }, []);
-
- const [listPorto, setListPorto] = useAtom(gs_ListPortofolio)
- useShallowEffect(() => {
- loadListPortofolio(profile?.id).then((res) => setListPorto(res));
- }, [profile?.id]);
-
+ const [porto, setPorto] = useState(listPorto);
return (
<>
- {/* {JSON.stringify(profile.id)}
-
- {JSON.stringify(listPorto)} */}
+ {/* {JSON.stringify(porto, null, 2)} */}
Portofolio
-
+
{(() => {
- if (listPorto) {
+ if (porto) {
return (
<>
- {_.map(listPorto).map((e: any) => (
-
+ {" "}
+ {_.map(porto as any).map((e: any) => (
+
{e.namaBisnis}
diff --git a/src/app_modules/katalog/profile/index.ts b/src/app_modules/katalog/profile/index.ts
index 70ca6dcc..cfa328c8 100644
--- a/src/app_modules/katalog/profile/index.ts
+++ b/src/app_modules/katalog/profile/index.ts
@@ -5,7 +5,7 @@ import EditProfileLayout from "./edit/layout";
import EditProfileView from "./edit/view";
import UploadFotoProfile from "./upload/view";
import UploadFotoProfileLayout from "./upload/layout"
-import ProfileView from "./view/view";
+import ProfileView from "./main/view";
export {
ProfileLayout,
diff --git a/src/app_modules/katalog/profile/view/view.tsx b/src/app_modules/katalog/profile/main/view.tsx
similarity index 72%
rename from src/app_modules/katalog/profile/view/view.tsx
rename to src/app_modules/katalog/profile/main/view.tsx
index 3157037f..88dddfb4 100644
--- a/src/app_modules/katalog/profile/view/view.tsx
+++ b/src/app_modules/katalog/profile/main/view.tsx
@@ -31,25 +31,18 @@ import { ApiHipmi } from "@/app/lib/api";
import { loadDataProfile } from "../fun/fun_get_profile";
import { getFotoProfile } from "../api/get-foto-profile";
import { gs_fotoProfile, gs_profile } from "../state/global_state";
+import { getProfile } from "..";
+import { USER_PROFILE } from "@/app_modules/models/user_profile";
+import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
-export default function ProfileView({ data }: { data: any }) {
+export default function ProfileView({ user }: { user: USER_PROFILE }) {
const router = useRouter();
-
- //Get data profile
- const [profile, setProfile] = useAtom(gs_profile);
+ const [stateUser, setStateUser] = useState(user);
useShallowEffect(() => {
- loadDataProfile(setProfile);
+ funGetUserProfile(user.id ?? "").then(setStateUser as any);
}, []);
- const [foto, setFoto] = useAtom(gs_fotoProfile);
- useShallowEffect(() => {
- if (profile?.imagesId === undefined) {
- return myConsole("Waiting data");
- } else {
- getFotoProfile(profile?.imagesId).then((v) => setFoto(v?.url));
- }
- }, [profile?.imagesId]);
-
+ if (!stateUser) return <>>;
return (
<>
{/* {JSON.stringify(data)} */}
@@ -74,18 +67,21 @@ export default function ProfileView({ data }: { data: any }) {
}}
>
-
+ />
+ )}
@@ -97,7 +93,7 @@ export default function ProfileView({ data }: { data: any }) {
variant="transparent"
bg={"gray"}
radius={50}
- onClick={() => router.push("/dev/katalog/profile/upload")}
+ onClick={() => router.push("/dev/profile/upload")}
sx={{ position: "relative" }}
>
@@ -109,14 +105,14 @@ export default function ProfileView({ data }: { data: any }) {
- {profile?.name}
+ {stateUser.Profile?.name}
- @{profile?.User?.username}
+ @{stateUser.username}
{
- router.push("/dev/katalog/profile/edit");
+ router.push("/dev/profile/edit");
}}
>
@@ -132,7 +128,7 @@ export default function ProfileView({ data }: { data: any }) {
{" "}
- +{profile?.User.nomor}
+ +{stateUser.nomor}
@@ -144,7 +140,7 @@ export default function ProfileView({ data }: { data: any }) {
{" "}
- {profile?.email}
+ {stateUser.Profile?.email}
@@ -154,12 +150,12 @@ export default function ProfileView({ data }: { data: any }) {
- {profile?.alamat}
+ {stateUser.Profile?.alamat}
{(() => {
- if (profile?.jenisKelamin === "Laki - laki") {
+ if (stateUser.Profile?.jenisKelamin === "Laki - laki") {
return (
<>
@@ -167,7 +163,7 @@ export default function ProfileView({ data }: { data: any }) {
- {profile?.jenisKelamin}
+ {stateUser.Profile?.jenisKelamin}
>
@@ -180,7 +176,7 @@ export default function ProfileView({ data }: { data: any }) {
- {profile?.jenisKelamin}
+ {stateUser.Profile?.jenisKelamin}
>
diff --git a/src/app_modules/katalog/profile/upload/view.tsx b/src/app_modules/katalog/profile/upload/view.tsx
index 19ed9a1d..8d0ee260 100644
--- a/src/app_modules/katalog/profile/upload/view.tsx
+++ b/src/app_modules/katalog/profile/upload/view.tsx
@@ -10,27 +10,15 @@ import { useState } from "react";
import { ApiHipmi } from "@/app/lib/api";
import { myConsole } from "@/app/fun/my_console";
-export default function UploadFotoProfile() {
- const [profile, setProfile] = useAtom(gs_profile);
- useShallowEffect(() => {
- loadDataProfile(setProfile);
- }, []);
-
- const [foto, setFoto] = useAtom(gs_fotoProfile)
- useShallowEffect(() => {
- if (profile?.imagesId === undefined || profile?.imagesId === null) {
- myConsole("Waiting data");
- } else {
- getFotoProfile(profile?.imagesId).then((res) => setFoto(res?.url));
- }
- }, [profile?.imagesId]);
+export default function UploadFotoProfile({imageUrl}: {imageUrl: any}) {
+ const [img, setImg] = useState(imageUrl)
return (
<>
{/* {JSON.stringify(foto)} */}
- {foto ? : }
+ {img ? : }
{/* {JSON.stringify(profile)} */}
diff --git a/src/app_modules/models/portofolio.ts b/src/app_modules/models/portofolio.ts
new file mode 100644
index 00000000..0a169463
--- /dev/null
+++ b/src/app_modules/models/portofolio.ts
@@ -0,0 +1,9 @@
+export interface LIST_PORTOFOLIO {
+ id: string;
+ namaBisnis: string;
+ alamatKantor: string;
+ tlpn: string;
+ deskripssi: string;
+ masterBidangBisnisId: string;
+ active: boolean;
+}
\ No newline at end of file
diff --git a/src/app_modules/models/user_profile.ts b/src/app_modules/models/user_profile.ts
new file mode 100644
index 00000000..ed0c2fcc
--- /dev/null
+++ b/src/app_modules/models/user_profile.ts
@@ -0,0 +1,15 @@
+export interface USER_PROFILE {
+ id: string;
+ username: string;
+ nomor: string;
+ Profile: {
+ id: string;
+ alamat: string;
+ email: string;
+ jenisKelamin: string;
+ name: string;
+ ImageProfile: {
+ url: string;
+ } | null;
+ } | null;
+}