Fix notifikasi
Deskripsi: - Fix notifikasi investasi
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { IconBan, IconCircleCheck } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
adminInvestasi_funAcceptTransaksiById,
|
||||
adminInvestasi_funGetAllTransaksiById,
|
||||
adminInvestasi_funRejectInvoiceById,
|
||||
} from "../../fun";
|
||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||
import { useState } from "react";
|
||||
import { IconCircleCheck } from "@tabler/icons-react";
|
||||
import { IconBan } from "@tabler/icons-react";
|
||||
import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import { IRealtimeData } from "@/app/lib/global_state";
|
||||
import {
|
||||
notifikasiToAdmin_funCreate,
|
||||
notifikasiToUser_funCreate,
|
||||
} from "@/app_modules/notifikasi/fun";
|
||||
import { WibuRealtime } from "wibu-pkg";
|
||||
|
||||
export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
|
||||
invoiceId,
|
||||
@@ -26,47 +33,112 @@ export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
|
||||
const [isLoadingReject, setLoadingReject] = useState(false);
|
||||
|
||||
async function onReject() {
|
||||
const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
|
||||
if (res.status == 200) {
|
||||
try {
|
||||
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||
investasiId,
|
||||
page: 1,
|
||||
try {
|
||||
setLoadingReject(true);
|
||||
|
||||
const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
|
||||
if (res.status == 200) {
|
||||
const notifikasiInvestor: IRealtimeData = {
|
||||
appId: invoiceId as string,
|
||||
userId: res.userId as string,
|
||||
status: res.statusName as any,
|
||||
pesan: "Transaksi anda gagal, coba hubungi admin",
|
||||
kategoriApp: "INVESTASI",
|
||||
title: "Transaksi Gagal",
|
||||
};
|
||||
|
||||
const notifToInvestor = await notifikasiToUser_funCreate({
|
||||
data: notifikasiInvestor as any,
|
||||
});
|
||||
onLoadData(dataTransaksi);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoadingReject(true);
|
||||
|
||||
if (notifToInvestor.status === 201) {
|
||||
WibuRealtime.setData({
|
||||
type: "notification",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: notifikasiInvestor,
|
||||
});
|
||||
|
||||
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||
investasiId,
|
||||
page: 1,
|
||||
});
|
||||
onLoadData(dataTransaksi);
|
||||
|
||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||
} catch (error) {
|
||||
clientLogger.error("Error rejected investasi:", error);
|
||||
} finally {
|
||||
setLoadingReject(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function onAccept() {
|
||||
const res = await adminInvestasi_funAcceptTransaksiById({
|
||||
invoiceId,
|
||||
investasiId,
|
||||
lembarTerbeli,
|
||||
});
|
||||
try {
|
||||
setLoadingAccept(true);
|
||||
const res = await adminInvestasi_funAcceptTransaksiById({
|
||||
invoiceId,
|
||||
investasiId,
|
||||
lembarTerbeli,
|
||||
});
|
||||
|
||||
if (res.status == 200) {
|
||||
const dataNotifikasi: IRealtimeData = {
|
||||
appId: investasiId,
|
||||
status: res.data?.dataInvestasi?.MasterStatusInvestasi?.name as any,
|
||||
userId: res.data?.dataInvestasi.authorId as string,
|
||||
pesan: "Cek investasi anda, Anda memiliki investor baru",
|
||||
kategoriApp: "INVESTASI",
|
||||
title: "Investor baru",
|
||||
};
|
||||
|
||||
const notif = await notifikasiToUser_funCreate({
|
||||
data: dataNotifikasi as any,
|
||||
});
|
||||
|
||||
if (notif.status === 201) {
|
||||
WibuRealtime.setData({
|
||||
type: "notification",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
}
|
||||
|
||||
const notifikasiInvestor: IRealtimeData = {
|
||||
appId: res.data?.dataInvestor.id as string,
|
||||
status: "Berhasil",
|
||||
userId: res.data?.dataInvestor.authorId as string,
|
||||
pesan: "Selamat, anda telah menjadi investor baru",
|
||||
kategoriApp: "INVESTASI",
|
||||
title: "Investasi berhasil",
|
||||
};
|
||||
|
||||
const notifToInvestor = await notifikasiToUser_funCreate({
|
||||
data: notifikasiInvestor as any,
|
||||
});
|
||||
|
||||
if (notifToInvestor.status === 201) {
|
||||
WibuRealtime.setData({
|
||||
type: "notification",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: notifikasiInvestor,
|
||||
});
|
||||
}
|
||||
|
||||
if (res.status == 200) {
|
||||
try {
|
||||
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||
investasiId,
|
||||
page: 1,
|
||||
});
|
||||
onLoadData(dataTransaksi);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoadingAccept(true);
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||
} catch (error) {
|
||||
clientLogger.error("Error accept invoice", error);
|
||||
} finally {
|
||||
setLoadingAccept(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ export function AdminInvestasi_DetailPublish({
|
||||
investasiId={investasiId}
|
||||
/>
|
||||
) : null}
|
||||
{/* {selectPage == "3" ? <AdminInvestasi_ViewDaftarInvestor /> : null} */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -60,15 +60,26 @@ export async function adminInvestasi_funAcceptTransaksiById({
|
||||
lembarTerbeli: resultLembarTerbeli.toString(),
|
||||
progress: resultProgres,
|
||||
},
|
||||
include: {
|
||||
MasterStatusInvestasi: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updateInvestasi)
|
||||
return { status: 400, message: "Gagal Update Data Investasi" };
|
||||
|
||||
const newData = updateInvestasi;
|
||||
|
||||
const allData = {
|
||||
dataInvestasi: updateInvestasi,
|
||||
dataInvestor: updt,
|
||||
};
|
||||
|
||||
revalidatePath(RouterAdminInvestasi.detail_publish);
|
||||
return {
|
||||
status: 200,
|
||||
message: "Update Berhasil",
|
||||
data: allData,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ export async function adminInvestasi_funRejectInvoiceById({
|
||||
}: {
|
||||
invoiceId: string;
|
||||
}) {
|
||||
|
||||
|
||||
|
||||
const updt = await prisma.investasi_Invoice.update({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
@@ -19,12 +16,19 @@ export async function adminInvestasi_funRejectInvoiceById({
|
||||
data: {
|
||||
statusInvoiceId: "4",
|
||||
},
|
||||
select: {
|
||||
StatusInvoice: true,
|
||||
authorId: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
if (!updt)
|
||||
return { status: 400, message: "Gagal Melakukan Reject", statusName: "" , userId: ""};
|
||||
revalidatePath(RouterAdminInvestasi.detail_publish);
|
||||
return {
|
||||
status: 200,
|
||||
message: "Update Berhasil",
|
||||
message: "Reject Berhasil",
|
||||
statusName: updt.StatusInvoice?.name,
|
||||
userId: updt.authorId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -62,12 +62,7 @@ function TableView({ listData }: { listData: any }) {
|
||||
useShallowEffect(() => {
|
||||
if (isAdminInvestasi_TriggerReview) {
|
||||
setIsShowReload(false);
|
||||
}
|
||||
}, [isAdminInvestasi_TriggerReview]);
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (isAdminInvestasi_TriggerReview) {
|
||||
setIsShowReload(true);
|
||||
setIsAdminInvestasi_TriggerReview(false)
|
||||
}
|
||||
}, [isAdminInvestasi_TriggerReview]);
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
||||
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { data } from "autoprefixer";
|
||||
import _ from "lodash";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
|
||||
import { admin_funDonasiCheckStatus } from "../fun/get/fun_donasi_check_status";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
|
||||
import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import { ITypeStatusNotifikasi } from "@/app/lib/global_state";
|
||||
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
|
||||
import { admin_funDonasiCheckStatus } from "../fun/get/fun_donasi_check_status";
|
||||
import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
|
||||
|
||||
export default async function adminNotifikasi_findRouterDonasi({
|
||||
appId,
|
||||
@@ -38,13 +34,29 @@ export default async function adminNotifikasi_findRouterDonasi({
|
||||
status == "Proses" ||
|
||||
status == "Gagal"
|
||||
) {
|
||||
const path = RouterAdminDonasi_OLD.detail_publish + appId;
|
||||
router.push(path, { scroll: false });
|
||||
onChangeNavbar({
|
||||
id: "Donasi",
|
||||
childId: "Donasi_2",
|
||||
const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
|
||||
notifId: notifikasiId,
|
||||
});
|
||||
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
page: 1,
|
||||
});
|
||||
onLoadDataNotifikasi(loadListNotifikasi);
|
||||
const path = RouterAdminDonasi_OLD.detail_publish + appId;
|
||||
router.push(path, { scroll: false });
|
||||
onChangeNavbar({
|
||||
id: "Donasi",
|
||||
childId: "Donasi_2",
|
||||
});
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
const check = await admin_funDonasiCheckStatus({ id: appId });
|
||||
|
||||
@@ -6,6 +6,7 @@ import { admin_funInvestasiCheckStatus } from "../fun/get/fun_investasi_check_st
|
||||
import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
|
||||
export default async function adminNotifikasi_findRouterInvestasi({
|
||||
appId,
|
||||
@@ -27,13 +28,15 @@ export default async function adminNotifikasi_findRouterInvestasi({
|
||||
childId: IAdmin_ActiveChildId;
|
||||
}) => void;
|
||||
}) {
|
||||
const check = await admin_funInvestasiCheckStatus({ id: appId });
|
||||
|
||||
if (check.status == 200) {
|
||||
if (
|
||||
status == "Menunggu" ||
|
||||
status == "Berhasil" ||
|
||||
status == "Proses" ||
|
||||
status == "Gagal"
|
||||
) {
|
||||
const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
|
||||
notifId: notifikasiId,
|
||||
});
|
||||
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
@@ -42,59 +45,72 @@ export default async function adminNotifikasi_findRouterInvestasi({
|
||||
page: 1,
|
||||
});
|
||||
onLoadDataNotifikasi(loadListNotifikasi);
|
||||
const path = RouterAdminInvestasi.detail_publish + appId;
|
||||
router.push(path, { scroll: false });
|
||||
|
||||
const path = `/dev/admin/investasi/sub-menu/${check.statusName}`;
|
||||
|
||||
if (check.statusName == "draft") {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
"Status telah dirubah oleh user"
|
||||
);
|
||||
} else {
|
||||
if (check.statusName == "publish") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_2",
|
||||
});
|
||||
}
|
||||
|
||||
if (check.statusName == "review") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_3",
|
||||
});
|
||||
}
|
||||
|
||||
if (check.statusName == "reject") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_4",
|
||||
});
|
||||
}
|
||||
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_2",
|
||||
});
|
||||
|
||||
return true;
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
|
||||
return false;
|
||||
const check = await admin_funInvestasiCheckStatus({ id: appId });
|
||||
|
||||
if (check.status == 200) {
|
||||
const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
|
||||
notifId: notifikasiId,
|
||||
});
|
||||
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
page: 1,
|
||||
});
|
||||
onLoadDataNotifikasi(loadListNotifikasi);
|
||||
|
||||
const path = `/dev/admin/investasi/sub-menu/${check.statusName}`;
|
||||
|
||||
if (check.statusName == "draft") {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
"Status telah dirubah oleh user"
|
||||
);
|
||||
} else {
|
||||
if (check.statusName == "publish") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_2",
|
||||
});
|
||||
}
|
||||
|
||||
if (check.statusName == "review") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_3",
|
||||
});
|
||||
}
|
||||
|
||||
if (check.statusName == "reject") {
|
||||
onChangeNavbar({
|
||||
id: "Investasi",
|
||||
childId: "Investasi_4",
|
||||
});
|
||||
}
|
||||
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// if (
|
||||
// status == "Menunggu" ||
|
||||
// status == "Berhasil" ||
|
||||
// status == "Proses" ||
|
||||
// status == "Gagal"
|
||||
// ) {
|
||||
// const path = RouterAdminDonasi_OLD.detail_publish + appId;
|
||||
// router.push(path, { scroll: false });
|
||||
// onChangeNavbar({
|
||||
// id: "Donasi",
|
||||
// childId: "Donasi_2",
|
||||
// });
|
||||
|
||||
// return true;
|
||||
// } else {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -13,18 +13,16 @@ import { IconCheck, IconChecks } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import adminNotifikasi_countNotifikasi from "./fun/count/count_is_read";
|
||||
import adminNotifikasi_getByUserId from "./fun/get/get_notifikasi_by_user_id";
|
||||
import adminNotifikasi_findRouterDonasi from "./route_setting/donasi";
|
||||
import { adminNotifikasi_findRouterEvent } from "./route_setting/event";
|
||||
import adminNotifikasi_findRouterInvestasi from "./route_setting/investasi";
|
||||
import { adminNotifikasi_findRouterJob } from "./route_setting/job";
|
||||
import {
|
||||
IAdmin_ActiveChildId,
|
||||
IAdmin_ActivePage,
|
||||
} from "./route_setting/type_of_select_page";
|
||||
import { adminNotifikasi_findRouterVoting } from "./route_setting/voting";
|
||||
import adminNotifikasi_findRouterDonasi from "./route_setting/donasi";
|
||||
import adminNotifikasi_findRouterInvestasi from "./route_setting/investasi";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
|
||||
export default function AdminNotifikasi_ViewCardDrawer({
|
||||
data,
|
||||
@@ -64,199 +62,200 @@ export default function AdminNotifikasi_ViewCardDrawer({
|
||||
|
||||
async function onRead() {
|
||||
// ========================== JOB ========================== //
|
||||
if (data?.kategoriApp === "JOB") {
|
||||
try {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
|
||||
const checkJob = await adminNotifikasi_findRouterJob({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
if (data?.kategoriApp === "JOB") {
|
||||
setDataId(data.id);
|
||||
|
||||
if (checkJob) {
|
||||
setIsAdminJob_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
const checkJob = await adminNotifikasi_findRouterJob({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
if (checkJob) {
|
||||
setIsAdminJob_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ========================== JOB ========================== //
|
||||
// ========================== JOB ========================== //
|
||||
|
||||
// ========================== EVENT ========================== //
|
||||
// ========================== EVENT ========================== //
|
||||
|
||||
if (data.kategoriApp == "EVENT") {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
if (data.kategoriApp == "EVENT") {
|
||||
setDataId(data.id);
|
||||
|
||||
const checkEvent = await adminNotifikasi_findRouterEvent({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
const checkEvent = await adminNotifikasi_findRouterEvent({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
if (checkEvent) {
|
||||
setIsAdminEvent_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
if (checkEvent) {
|
||||
setIsAdminEvent_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ========================== EVENT ========================== //
|
||||
// ========================== EVENT ========================== //
|
||||
|
||||
// ========================== VOTING ========================== //
|
||||
// ========================== VOTING ========================== //
|
||||
|
||||
if (data.kategoriApp == "VOTING") {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
if (data.kategoriApp == "VOTING") {
|
||||
setDataId(data.id);
|
||||
|
||||
const checkVoting = await adminNotifikasi_findRouterVoting({
|
||||
router: router,
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
const checkVoting = await adminNotifikasi_findRouterVoting({
|
||||
router: router,
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
activePage: activePage,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
if (checkVoting) {
|
||||
setIsAdminVoting_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
if (checkVoting) {
|
||||
setIsAdminVoting_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ========================== VOTING ========================== //
|
||||
// ========================== VOTING ========================== //
|
||||
|
||||
// ========================== DONASI ========================== //
|
||||
// ========================== DONASI ========================== //
|
||||
|
||||
if (data.kategoriApp == "DONASI") {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
if (data.kategoriApp == "DONASI") {
|
||||
setDataId(data.id);
|
||||
|
||||
const checkDonasi = await adminNotifikasi_findRouterDonasi({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
status: data.status as ITypeStatusNotifikasi,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
const checkDonasi = await adminNotifikasi_findRouterDonasi({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
status: data.status as ITypeStatusNotifikasi,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
if (checkDonasi) {
|
||||
setIsAdminDonasi_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
if (checkDonasi) {
|
||||
setIsAdminDonasi_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// ========================== DONASI ========================== //
|
||||
// ========================== DONASI ========================== //
|
||||
|
||||
// ========================== INVESTASI ========================== //
|
||||
// ========================== INVESTASI ========================== //
|
||||
|
||||
if (data.kategoriApp == "INVESTASI") {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
if (data.kategoriApp == "INVESTASI") {
|
||||
setDataId(data.id);
|
||||
|
||||
const checkInvestasi = await adminNotifikasi_findRouterInvestasi({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
status: data.status as ITypeStatusNotifikasi,
|
||||
router: router,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
const checkInvestasi = await adminNotifikasi_findRouterInvestasi({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
status: data.status as ITypeStatusNotifikasi,
|
||||
router: router,
|
||||
onLoadCountNotif(val) {
|
||||
onLoadCountNotif(val);
|
||||
},
|
||||
onLoadDataNotifikasi(val) {
|
||||
onLoadDataNotifikasi(val);
|
||||
},
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
childId: val.childId,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
if (checkInvestasi) {
|
||||
setIsAdminDonasi_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
if (checkInvestasi) {
|
||||
setIsAdminDonasi_TriggerReview(false);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
onToggleNavbar(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// // FORUM
|
||||
// e?.kategoriApp === "FORUM" &&
|
||||
// adminNotifikasi_findRouterForum({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
} catch (error) {
|
||||
clientLogger.error("Error notifikasi function", error);
|
||||
} finally {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
// // FORUM
|
||||
// e?.kategoriApp === "FORUM" &&
|
||||
// adminNotifikasi_findRouterForum({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // VOTE
|
||||
// e?.kategoriApp === "VOTING" &&
|
||||
// adminNotifikasi_findRouterVoting({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user