|
{noAwal++}
|
{e?.Author?.Profile?.name}
|
{e?.title}
|
{e?.ProjectCollaborationMaster_Industri.name}
|
{e?.ProjectCollaboration_Partisipasi.length}
|
}
loaderPosition="center"
radius={"xl"}
color="green"
onClick={() => {
getDetailData(e.id);
}}
>
Detail
}
loaderPosition="center"
radius={"xl"}
color="red"
onClick={() => {
onRejected(e.id);
}}
>
Reject
|
));
// Menampilkan Detail Data
async function getDetailData(colabId: any) {
setLoadingDetail(true);
setIdProject(colabId);
await adminColab_getOneByColabId({ id: colabId }).then((res) => {
if (res.status === 200) {
setDetailData(res.data as any);
setOpenDetail(true);
setLoadingDetail(false);
} else {
ComponentGlobal_NotifikasiPeringatan("Gagal Load");
}
});
}
// Menampilkan Data Title yang akan di REJECT
async function onRejected(colabId: string) {
setLoadingReject(true);
setIdProject(colabId);
await adminColab_getOneByColabId({ id: colabId }).then((res) => {
if (res.status === 200) {
const selectedData = _.omit(res.data, [
"Author",
"ProjectCollaborationMaster_Industri",
"ProjectCollaboration_Partisipasi",
"benefit",
"createdAt",
"purpose",
"lokasi",
]);
setDetailData(selectedData as any);
setOpenReject(true);
setLoadingReject(false);
} else {
ComponentGlobal_NotifikasiPeringatan("Gagal Load");
}
});
}
// Update status report pada project
async function onReport() {
if (report === "")
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Alasan Report");
await adminColab_funReportProjectById({
colabId: idProject,
report: report,
}).then(async (res) => {
if (res.status === 200) {
const newData = await adminColab_getListAllPublish({
page: activePage,
});
setActivePage(activePage);
setData(newData.data as any);
setNPage(newData.nPage);
setOpenReject(false);
ComponentGlobal_NotifikasiBerhasil(res.message);
} else {
ComponentGlobal_NotifikasiPeringatan(res.message);
}
});
}
return (
<>