-
+
{imgBG ? (
@@ -257,9 +256,8 @@ export default function CreateProfile({
diff --git a/src/app_modules/katalog/profile/fun/fun_create_profile.ts b/src/app_modules/katalog/profile/fun/fun_create_profile.ts
index 4ea46b99..eb49f756 100644
--- a/src/app_modules/katalog/profile/fun/fun_create_profile.ts
+++ b/src/app_modules/katalog/profile/fun/fun_create_profile.ts
@@ -7,82 +7,37 @@ import { v4 } from "uuid";
import fs from "fs";
import { revalidatePath } from "next/cache";
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { Prisma } from "@prisma/client";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-export default async function funCreateNewProfile(
- req: MODEL_PROFILE,
- gambarPP: FormData,
- gambarBG: FormData
-) {
- const body = req;
+export default async function funCreateNewProfile({
+ data,
+ imageId,
+ imageBackgroundId,
+}: {
+ data: Prisma.ProfileCreateInput;
+ imageId: string;
+ imageBackgroundId: string;
+}) {
+ const userLoginId = await funGetUserIdByToken();
const findEmail = await prisma.profile.findUnique({
where: {
- email: body.email,
+ email: data.email,
},
});
if (findEmail) return { status: 400, message: "Email telah digunakan" };
- const gambarProfile: any = gambarPP.get("filePP");
-
- if (gambarProfile === "null")
- return { status: 400, message: "Lengkapi Foto Profile" };
-
- const fileName = gambarProfile.name;
- const fileExtension = _.lowerCase(gambarProfile.name.split(".").pop());
- const fRandomName = v4(fileName) + "." + fileExtension;
-
- const uploadPP = await prisma.images.create({
- data: {
- url: fRandomName,
- label: "PROFILE_FOTO",
- },
- select: {
- id: true,
- url: true,
- },
- });
-
- if (!uploadPP) return { status: 400, message: "Gagal upload foto profile" };
- const uploadPP_Folder = Buffer.from(await gambarProfile.arrayBuffer());
- fs.writeFileSync(`./public/profile/foto/${uploadPP.url}`, uploadPP_Folder);
-
- const gambarBackground: any = gambarBG.get("fileBG");
- if (gambarBackground === "null")
- return { status: 400, message: "Lengkapi Foto Background" };
-
- const fileNameBG = gambarBackground.name;
- const fileExtensionBG = _.lowerCase(gambarBackground.name.split(".").pop());
- const fRandomNameBG = v4(fileNameBG) + "." + fileExtensionBG;
-
- const uploadBG = await prisma.imagesBackground.create({
- data: {
- url: fRandomNameBG,
- label: "PROFILE_BACKGROUND",
- },
- select: {
- id: true,
- url: true,
- },
- });
-
- if (!uploadBG)
- return { status: 400, message: "Gagal upload background profile" };
- const uploadBG_Folder = Buffer.from(await gambarBackground.arrayBuffer());
- fs.writeFileSync(
- `./public/profile/background/${uploadBG.url}`,
- uploadBG_Folder
- );
-
const createProfile = await prisma.profile.create({
data: {
- userId: body.userId,
- name: body.name,
- email: body.email,
- alamat: body.alamat,
- jenisKelamin: body.jenisKelamin,
- imagesId: uploadPP.id,
- imagesBackgroundId: uploadBG.id,
+ userId: userLoginId,
+ name: data.name,
+ email: data.email,
+ alamat: data.alamat,
+ jenisKelamin: data.jenisKelamin,
+ imageId: imageId,
+ imageBackgroundId: imageBackgroundId,
},
});
diff --git a/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts b/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts
index 9403b99a..af986a3e 100644
--- a/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts
+++ b/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts
@@ -7,18 +7,8 @@ export async function Profile_getOneProfileAndUserById(profileId: string) {
where: {
id: profileId,
},
- select: {
- userId: true,
+ include: {
User: true,
- id: true,
- name: true,
- email: true,
- alamat: true,
- jenisKelamin: true,
- imagesId: true,
- imagesBackgroundId: true,
- ImageProfile: true,
- ImagesBackground: true,
},
});
// console.log(data)
diff --git a/src/app_modules/katalog/profile/fun/index.ts b/src/app_modules/katalog/profile/fun/index.ts
new file mode 100644
index 00000000..65584ebc
--- /dev/null
+++ b/src/app_modules/katalog/profile/fun/index.ts
@@ -0,0 +1,3 @@
+import { profile_funUpdatePhoto } from "./update/fun_update_foto_profile";
+
+export { profile_funUpdatePhoto };
diff --git a/src/app_modules/katalog/profile/fun/update/fun_update_background.ts b/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
index aa01c47f..55fe194f 100644
--- a/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
+++ b/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
@@ -1,47 +1,21 @@
"use server";
-import fs from "fs";
import prisma from "@/app/lib/prisma";
-import _ from "lodash";
-import { v4 } from "uuid";
import { revalidatePath } from "next/cache";
-export async function Profile_funUpdateBackground(
- profileId: string,
- file: FormData
-) {
- const gambarBackground: any = file.get("file");
- const fileName = gambarBackground.name;
- const fileExtension = _.lowerCase(gambarBackground.name.split(".").pop());
- const fRandomName = v4(fileName) + "." + fileExtension;
-
- const uploadBG = await prisma.imagesBackground.create({
- data: {
- url: fRandomName,
- label: "PROFILE_BACKGROUND",
- },
- select: {
- id: true,
- url: true,
- },
- });
-
- if (!uploadBG)
- return { status: 400, message: "Gagal upload gambar background" };
- const uploadBG_Folder = Buffer.from(await gambarBackground.arrayBuffer());
- fs.writeFileSync(
- `./public/profile/background/${uploadBG.url}`,
- uploadBG_Folder
- );
-
- revalidatePath("/dev/katalog");
-
+export async function profile_funUpdateBackground({
+ profileId,
+ fileId,
+}: {
+ profileId: string;
+ fileId: string;
+}) {
const updateBackground = await prisma.profile.update({
where: {
id: profileId,
},
data: {
- imagesBackgroundId: uploadBG.id,
+ imageBackgroundId: fileId,
},
});
@@ -53,50 +27,4 @@ export async function Profile_funUpdateBackground(
status: 200,
message: "Update berhasil",
};
-
- // const findProfile = await prisma.profile.findFirst({
- // where: {
- // id: profileId,
- // },
- // });
-
- // const findBackground = await prisma.imagesBackground.findFirst({
- // where: {
- // id: findProfile?.imagesBackgroundId as string,
- // },
- // select: {
- // url: true,
- // },
- // });
- // if (!findBackground) return { status: 400, message: "Foto tidak ditemukan" };
- // if (findBackground) fs.unlinkSync(`./public/profile/background/${findBackground.url}`);
-
- // const gambarBackground: any = file.get("file");
- // const fileName = gambarBackground.name;
- // const fileExtension = _.lowerCase(gambarBackground.name.split(".").pop());
- // const randomName = v4(fileName) + "." + fileExtension;
-
- // const uploadBG = await prisma.imagesBackground.update({
- // where: {
- // id: findProfile?.imagesBackgroundId as string,
- // },
- // data: {
- // url: randomName,
- // label: "PROFILE_BACKGROUND",
- // },
- // select: {
- // id: true,
- // url: true,
- // },
- // });
-
- // if (!uploadBG) return { status: 400, message: "Gagal upload foto background" };
- // const uploadBG_Folder = Buffer.from(await gambarBackground.arrayBuffer());
- // fs.writeFileSync(`./public/profile/background/${uploadBG.url}`, uploadBG_Folder);
- // revalidatePath("/dev/katalog");
-
- // return {
- // status: 200,
- // message: "Update berhasil",
- // };
}
diff --git a/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts b/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
index 04241158..0d4d58a5 100644
--- a/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
+++ b/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
@@ -1,38 +1,21 @@
"use server";
-import fs from "fs";
import prisma from "@/app/lib/prisma";
-import _ from "lodash";
-import { v4 } from "uuid";
import { revalidatePath } from "next/cache";
-export async function Profile_funUpdateFoto(profileId: string, file: FormData) {
- const gambarProfile: any = file.get("file");
- const fileName = gambarProfile.name;
- const fileExtension = _.lowerCase(gambarProfile.name.split(".").pop());
- const fRandomName = v4(fileName) + "." + fileExtension;
-
- const uploadPP = await prisma.images.create({
- data: {
- url: fRandomName,
- label: "PROFILE_FOTO",
- },
- select: {
- id: true,
- url: true,
- },
- });
-
- if (!uploadPP) return { status: 400, message: "Gagal upload foto profile" };
- const uploadPP_Folder = Buffer.from(await gambarProfile.arrayBuffer());
- fs.writeFileSync(`./public/profile/foto/${uploadPP.url}`, uploadPP_Folder);
-
+export async function profile_funUpdatePhoto({
+ profileId,
+ fileId,
+}: {
+ profileId: string;
+ fileId: string;
+}) {
const updateProfile = await prisma.profile.update({
where: {
id: profileId,
},
data: {
- imagesId: uploadPP.id,
+ imageId: fileId,
},
});
@@ -43,52 +26,4 @@ export async function Profile_funUpdateFoto(profileId: string, file: FormData) {
status: 200,
message: "Update berhasil",
};
-
-
-
- // const findProfile = await prisma.profile.findFirst({
- // where: {
- // id: profileId,
- // },
- // });
-
- // const findFoto = await prisma.images.findFirst({
- // where: {
- // id: findProfile?.imagesId as string,
- // },
- // select: {
- // url: true,
- // },
- // });
- // if (!findFoto) return { status: 400, message: "Foto tidak ditemukan" };
- // if (findFoto) fs.unlinkSync(`./public/profile/foto/${findFoto.url}`);
-
- // const gambarProfile: any = file.get("file");
- // const fileName = gambarProfile.name;
- // const fileExtension = _.lowerCase(gambarProfile.name.split(".").pop());
- // const randomName = v4(fileName) + "." + fileExtension;
-
- // const uploadPP = await prisma.images.update({
- // where: {
- // id: findProfile?.imagesId as string,
- // },
- // data: {
- // url: randomName,
- // label: "PROFILE_FOTO",
- // },
- // select: {
- // id: true,
- // url: true,
- // },
- // });
-
- // if (!uploadPP) return { status: 400, message: "Gagal upload foto profile" };
- // const uploadPP_Folder = Buffer.from(await gambarProfile.arrayBuffer());
- // fs.writeFileSync(`./public/profile/foto/${uploadPP.url}`, uploadPP_Folder);
- // revalidatePath("/dev/katalog");
-
- // return {
- // status: 200,
- // message: "Update berhasil",
- // };
}
diff --git a/src/app_modules/katalog/profile/index.ts b/src/app_modules/katalog/profile/index.ts
index b23c734c..093b08c2 100644
--- a/src/app_modules/katalog/profile/index.ts
+++ b/src/app_modules/katalog/profile/index.ts
@@ -2,12 +2,14 @@ import ProfileLayout from "./create/layout";
import CreateProfile from "./create/view";
import EditProfileLayout from "./edit/layout";
import EditProfileView from "./edit/view";
-import ProfileView from "./main/view_profile";
import UploadFotoProfile from "./upload/foto_profile";
import UploadFotoProfileLayout from "./upload/foto_profile/layout";
export {
- CreateProfile, EditProfileLayout, EditProfileView, ProfileLayout, ProfileView, UploadFotoProfile,
- UploadFotoProfileLayout
+ CreateProfile,
+ EditProfileLayout,
+ EditProfileView,
+ ProfileLayout,
+ UploadFotoProfile,
+ UploadFotoProfileLayout,
};
-
diff --git a/src/app_modules/katalog/profile/main/view_profile.tsx b/src/app_modules/katalog/profile/main/view_profile.tsx
deleted file mode 100644
index 1bc79085..00000000
--- a/src/app_modules/katalog/profile/main/view_profile.tsx
+++ /dev/null
@@ -1,276 +0,0 @@
-"use client";
-
-import { Warna } from "@/app/lib/warna";
-import {
- ActionIcon,
- AspectRatio,
- Avatar,
- BackgroundImage,
- Box,
- Center,
- Flex,
- Grid,
- Group,
- Image,
- Paper,
- Stack,
- Text,
-} from "@mantine/core";
-import { useShallowEffect } from "@mantine/hooks";
-import {
- IconAddressBook,
- IconCamera,
- IconEditCircle,
- IconGenderFemale,
- IconGenderMale,
- IconHome,
- IconMail,
-} from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { MODEL_PROFILE } from "../model/interface";
-import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
-
-export default function ProfileView({
- profile,
- userLoginId,
-}: {
- profile: MODEL_PROFILE;
- userLoginId: string;
-}) {
- const router = useRouter();
- const [loadingPP, setLoadingPP] = useState(false);
- const [loadingBG, setLoadingBG] = useState(false);
- const [loadingEdit, setLoadingEdit] = useState(false);
-
-
- return (
- <>
- {/* {JSON.stringify(profile, null,2)} */}
-
- {/* Background dan foto */}
-
- {/* Upload Background Profile */}
-
-
-
-
-
-
-
- {/* Upload Background Profile */}
- {profile?.User.id === userLoginId ? (
-
- {
- setLoadingBG(true);
- router.push(
- RouterProfile.update_foto_background + `${profile.id}`
- );
- }}
- sx={{
- position: "relative",
- color: "gray",
- border: "1px",
- borderStyle: "solid",
- }}
- >
-
-
-
- ) : (
- ""
- )}
-
- {/* Foto Profile */}
-
-
-
-
-
-
- {/* Upload Foto Profile */}
- {profile?.User.id === userLoginId ? (
-
- {
- setLoadingPP(true);
- router.push(
- RouterProfile.update_foto_profile + `${profile.id}`
- );
- }}
- sx={{
- position: "relative",
- border: "1px",
- borderStyle: "solid",
- }}
- >
-
-
-
- ) : (
- ""
- )}
-
-
- {/* Username dan Nama */}
-
-
-
-
-
- {profile?.name}
-
-
- @{profile?.User?.username}
-
-
-
-
- {profile?.User.id === userLoginId ? (
- {
- setLoadingEdit(true);
- router.push(RouterProfile.edit + `${profile.id}`);
- }}
- >
-
-
- ) : (
- ""
- )}
-
-
-
- {/*
-
- */}
-
- {/* Info user: nomor, email dll */}
-
-
-
-
-
-
-
- {" "}
- +{profile?.User.nomor}
-
-
-
-
-
-
-
-
-
-
- {" "}
- {profile?.email}
-
-
-
-
-
-
-
-
-
- {profile?.alamat}
-
-
-
- {(() => {
- if (profile?.jenisKelamin === "Laki - laki") {
- return (
- <>
-
-
-
-
-
- {profile?.jenisKelamin}
-
-
- >
- );
- } else {
- return (
- <>
-
-
-
-
-
- {profile?.jenisKelamin}
-
-
- >
- );
- }
- })()}
-
-
-
- {/* {JSON.stringify(profile, null, 2)} */}
- >
- );
-}
diff --git a/src/app_modules/katalog/profile/model/interface.ts b/src/app_modules/katalog/profile/model/interface.ts
index 3a4d2ad1..e4d8a0e9 100644
--- a/src/app_modules/katalog/profile/model/interface.ts
+++ b/src/app_modules/katalog/profile/model/interface.ts
@@ -16,4 +16,6 @@ export interface MODEL_PROFILE {
imagesId: string;
ImagesBackground: MODEL_IMAGES;
imagesBackgroundId: string;
+ imageId?: string;
+ imageBackgroundId?: string;
}
diff --git a/src/app_modules/katalog/profile/upload/foto_background/index.tsx b/src/app_modules/katalog/profile/upload/foto_background/index.tsx
index c45a46d5..12d03b46 100644
--- a/src/app_modules/katalog/profile/upload/foto_background/index.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_background/index.tsx
@@ -1,138 +1,52 @@
"use client";
+import { APIs } from "@/app/lib";
import {
- AspectRatio,
- Button,
- Center,
- FileButton,
- Image,
- Paper,
- Stack,
-} from "@mantine/core";
-
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import { AspectRatio, Center, Image, Stack } from "@mantine/core";
import { useState } from "react";
-
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { IconCamera } from "@tabler/icons-react";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
-import { Profile_funUpdateBackground } from "../../fun/update/fun_update_background";
+import { Profile_ComponentButtonUpdateBackgroundProfile } from "../../_component";
import { MODEL_PROFILE } from "../../model/interface";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
export default function Profile_UpdateFotoBackground({
dataProfile,
}: {
dataProfile: MODEL_PROFILE;
}) {
- const router = useRouter();
const [profile, setProfile] = useState(dataProfile);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
- const [loading, setLoading] = useState(false);
return (
<>
-
-
-
-
-
-
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- if (files.size > 2000000) {
- ComponentGlobal_NotifikasiPeringatan(
- "Maaf, Ukuran file terlalu besar, maximum 2mb",
- 3000
- );
- } else {
- setImage(buffer);
- setFile(files);
- }
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
>
);
}
-
-async function onUpdate(
- router: AppRouterInstance,
- profileId: string,
- file: FormData,
- setLoading: any
-) {
- const gambar = new FormData();
- gambar.append("file", file as any);
-
- await Profile_funUpdateBackground(profileId, gambar).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
diff --git a/src/app_modules/katalog/profile/upload/foto_profile/index.tsx b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
index fa083561..6e49f09f 100644
--- a/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
@@ -1,137 +1,47 @@
"use client";
+import { APIs } from "@/app/lib";
import {
- AspectRatio,
- Button,
- Center,
- FileButton,
- Image,
- Paper,
- Stack,
- Title,
-} from "@mantine/core";
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import { AspectRatio, Center, Image, Stack } from "@mantine/core";
import { useState } from "react";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { Profile_ComponentButtonUpdatePhotoProfile } from "../../_component";
import { MODEL_PROFILE } from "../../model/interface";
-import { IconCamera } from "@tabler/icons-react";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
-import { Profile_funUpdateFoto } from "../../fun/update/fun_update_foto_profile";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
export default function UploadFotoProfile({
dataProfile,
}: {
dataProfile: MODEL_PROFILE;
}) {
- const router = useRouter();
const [profile, setProfile] = useState(dataProfile);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
- const [loading, setLoading] = useState(false);
return (
<>
-
-
-
-
-
-
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- if (files.size > 2000000) {
- ComponentGlobal_NotifikasiPeringatan(
- "Maaf, Ukuran file terlalu besar, maximum 2mb",
- 3000
- );
- } else {
- setImage(buffer);
- setFile(files);
- }
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
>
);
}
-
-async function onUpdate(
- router: AppRouterInstance,
- profileId: string,
- file: FormData,
- setLoading: any
-) {
- const gambar = new FormData();
- gambar.append("file", file as any);
-
- await Profile_funUpdateFoto(profileId, gambar).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
diff --git a/src/app_modules/katalog/ui/ui_list_portofolio.tsx b/src/app_modules/katalog/ui/ui_list_portofolio.tsx
index 3a2f6c6a..7e237b67 100644
--- a/src/app_modules/katalog/ui/ui_list_portofolio.tsx
+++ b/src/app_modules/katalog/ui/ui_list_portofolio.tsx
@@ -48,10 +48,10 @@ export function Portofolio_UiListView({
}}
>
-
-
+
+
Portofolio
- {profile?.User.id === userLoginId ? (
+ {/* {profile?.User.id === userLoginId ? (
{
@@ -69,7 +69,7 @@ export function Portofolio_UiListView({
) : (
- )}
+ )} */}
-
+ {/*
+ src={APIs.GET({ fileId: profile.imageBackgroundId as string })}
+ /> */}
+
-
+ {/*
+ /> */}
@@ -128,7 +126,7 @@ export function Profile_UiView({
{listInformation.map((e, i) => (
-
+
{e.icon}
-
+
{e?.value}
))}
- {/*
- {JSON.stringify(profile, null, 2)}
- */}
>
);
diff --git a/src/app_modules/map/_component/detail_data.tsx b/src/app_modules/map/_component/detail_data.tsx
index 5eab05a6..071cb37f 100644
--- a/src/app_modules/map/_component/detail_data.tsx
+++ b/src/app_modules/map/_component/detail_data.tsx
@@ -61,7 +61,9 @@ export function ComponentMap_DetailData({ mapId }: { mapId: any }) {
{ maxWidth: 600, cols: 1, spacing: "sm" },
]}
>
-
+
{/* */}
diff --git a/src/app_modules/map/ui/ui_custom_pin.tsx b/src/app_modules/map/ui/ui_custom_pin.tsx
index 2c66d97d..0b963d28 100644
--- a/src/app_modules/map/ui/ui_custom_pin.tsx
+++ b/src/app_modules/map/ui/ui_custom_pin.tsx
@@ -72,8 +72,8 @@ export function UiMap_CustomPin({
radius={"100%"}
src={
data.pinId === null
- ? APIs.GET + data.Portofolio.logoId
- : APIs.GET + data.pinId
+ ? APIs.GET({ fileId: data.Portofolio.logoId })
+ : APIs.GET({ fileId: data.pinId })
}
style={{
border: `2px solid ${AccentColor.skyblue}`,
@@ -155,8 +155,8 @@ export function UiMap_CustomPin({
imgPin
? imgPin
: data.pinId === null
- ? APIs.GET + data.Portofolio.logoId
- : APIs.GET + data.pinId
+ ? APIs.GET({ fileId: data.Portofolio.logoId })
+ : APIs.GET({ fileId: data.pinId })
}
style={{
border: `2px solid ${AccentColor.softblue}`,
diff --git a/src/app_modules/map/ui/ui_edit_map.tsx b/src/app_modules/map/ui/ui_edit_map.tsx
index ea6fa51c..494780ef 100644
--- a/src/app_modules/map/ui/ui_edit_map.tsx
+++ b/src/app_modules/map/ui/ui_edit_map.tsx
@@ -36,7 +36,10 @@ import { map_funEditMap } from "../fun/edit/fun_edit_map";
import { defaultMapZoom } from "../lib/default_lat_long";
import { MODEL_MAP } from "../lib/interface";
import { APIs } from "@/app/lib";
-import { ComponentGlobal_BoxUploadImage, ComponentGlobal_LoadImage } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_LoadImage,
+} from "@/app_modules/_global/component";
import { ComponentMap_ButtonUpdateDataMap } from "../_component";
export function UiMap_EditMap({
@@ -90,8 +93,8 @@ export function UiMap_EditMap({
) : (
)}
@@ -235,5 +237,3 @@ export function UiMap_EditMap({
>
);
}
-
-
diff --git a/src/app_modules/map/ui/ui_map.tsx b/src/app_modules/map/ui/ui_map.tsx
index 77f66f70..854392d0 100644
--- a/src/app_modules/map/ui/ui_map.tsx
+++ b/src/app_modules/map/ui/ui_map.tsx
@@ -91,8 +91,8 @@ export function UiMap_MapBoxView({
}}
src={
e.pinId === null
- ? APIs.GET + e.Portofolio.logoId
- : APIs.GET + e.pinId
+ ? APIs.GET({ fileId: e.Portofolio.logoId })
+ : APIs.GET({ fileId: e.pinId })
}
/>