fix collaboration notifikasi
This commit is contained in:
@@ -25,6 +25,7 @@ import { redirectDetailForumPage } from "./path/forum";
|
||||
import { redirectInvestasiPage } from "./path/investasi";
|
||||
import { notifikasi_jobCheckStatus } from "./path/job";
|
||||
import { notifikasi_votingCheckStatus } from "./path/voting";
|
||||
import { redirectDetailCollaborationPage } from "./path/collaboration";
|
||||
|
||||
export function ComponentNotifiaksi_CardView({
|
||||
data,
|
||||
@@ -157,11 +158,17 @@ export function ComponentNotifiaksi_CardView({
|
||||
return;
|
||||
}
|
||||
|
||||
// data?.kategoriApp === "COLLABORATION" &&
|
||||
// redirectDetailCollaborationPage({
|
||||
// data: data,
|
||||
// router: router,
|
||||
// });
|
||||
if (data?.kategoriApp === "COLLABORATION") {
|
||||
await redirectDetailCollaborationPage({
|
||||
data: data,
|
||||
router: router,
|
||||
onSetVisible(val) {
|
||||
setVisible(val);
|
||||
},
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
setVisible(false);
|
||||
clientLogger.error("Error redirect notification page", error);
|
||||
|
||||
@@ -1,26 +1,40 @@
|
||||
import { RouterColab } from "@/lib/router_hipmi/router_colab";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { MODEL_NOTIFIKASI } from "../../model/interface";
|
||||
import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_by_user_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
||||
|
||||
export function redirectDetailCollaborationPage({
|
||||
export async function redirectDetailCollaborationPage({
|
||||
data,
|
||||
router,
|
||||
onSetVisible,
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
router: AppRouterInstance;
|
||||
onSetVisible(val: boolean): void;
|
||||
}) {
|
||||
if (data.status === "Partisipan Project") {
|
||||
const path = RouterColab.main_detail + data.appId;
|
||||
router.push(path, { scroll: false });
|
||||
try {
|
||||
if (data.status === "Partisipan Project") {
|
||||
const path = RouterColab.main_detail + data.appId;
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
if (data.status === "Collaboration Group") {
|
||||
const path = RouterColab.grup_diskusi;
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
|
||||
notifId: data.id,
|
||||
});
|
||||
|
||||
if (updateReadNotifikasi.status == 200) {
|
||||
onSetVisible(true);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error get all forum :", error);
|
||||
ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (data.status === "Collaboration Group") {
|
||||
const path = RouterColab.grup_diskusi;
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
// if (data.status === "Report Komentar") {
|
||||
// const path = RouterForum.detail_report_komentar + data.appId;
|
||||
// router.push(path, { scroll: false });
|
||||
|
||||
Reference in New Issue
Block a user