fix ( upload image & api )
deskripsi: - fix upload dokumen investasi - fix api investasi
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { IconDots, IconEdit, IconTrash } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
@@ -30,6 +30,8 @@ import {
|
||||
ComponentGlobal_NotifikasiBerhasil,
|
||||
ComponentGlobal_NotifikasiPeringatan,
|
||||
} from "@/app_modules/_global/notif_global";
|
||||
import { apiGetDokumenInvestasiById } from "../../_lib/api_interface";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
|
||||
export function Investasi_ComponentCardRekapDocument({
|
||||
data,
|
||||
@@ -38,6 +40,9 @@ export function Investasi_ComponentCardRekapDocument({
|
||||
data: MODEL_INVESTASI_DOKUMEN;
|
||||
onSetData: (val: any) => any[];
|
||||
}) {
|
||||
const params = useParams<{ id: string }>();
|
||||
const investasiId = params.id;
|
||||
|
||||
const router = useRouter();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [isLoadingEdit, setIsLoadingEdit] = useState(false);
|
||||
@@ -63,18 +68,22 @@ export function Investasi_ComponentCardRekapDocument({
|
||||
|
||||
if (deleteFromDB.status !== 200) {
|
||||
ComponentGlobal_NotifikasiPeringatan(deleteFromDB.message);
|
||||
return;
|
||||
}
|
||||
ComponentGlobal_NotifikasiBerhasil(deleteFromDB.message);
|
||||
setOpenModal(false);
|
||||
|
||||
const loadData = await investasi_funGetAllDocumentById({
|
||||
investasiId: data.investasiId,
|
||||
page: 1,
|
||||
const respone = await apiGetDokumenInvestasiById({
|
||||
id: investasiId,
|
||||
kategori: "get-all",
|
||||
page: "1",
|
||||
});
|
||||
|
||||
onSetData(loadData);
|
||||
if (respone.success) {
|
||||
onSetData(respone.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
clientLogger.error("Error hapus dokumen", error);
|
||||
} finally {
|
||||
setIsLoadingDelete(false);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||
import { Box, Center, Stack } from "@mantine/core";
|
||||
|
||||
export { Investasi_SkeletonEditProspektus };
|
||||
export { Investasi_SkeletonEditProspektus, Investasi_SkeletonListDokumen };
|
||||
|
||||
function Investasi_SkeletonEditProspektus() {
|
||||
return (
|
||||
@@ -33,3 +33,14 @@ function Investasi_SkeletonEditProspektus() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function Investasi_SkeletonListDokumen() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<CustomSkeleton h={70} radius={"md"} />
|
||||
<CustomSkeleton h={70} radius={"md"} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user