# feat:
## Deskripsi: - Notifikasi admin to user - Notifikasi user to user ### Issue: - Pada table admin harus di sediakan untuk triger update data saat ada notifikasi
This commit is contained in:
36
src/app_modules/notifikasi/component/path/event.ts
Normal file
36
src/app_modules/notifikasi/component/path/event.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { MODEL_NOTIFIKASI } from "../../model/interface";
|
||||
|
||||
export function redirectEventPage({
|
||||
data,
|
||||
router,
|
||||
onSetPage,
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
router: AppRouterInstance;
|
||||
onSetPage: (val: any) => void;
|
||||
}) {
|
||||
const path = RouterEvent.status_page;
|
||||
|
||||
if (data.status === "Publish") {
|
||||
onSetPage({
|
||||
menuId: 2,
|
||||
status: data.status,
|
||||
});
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
// console.log(data)
|
||||
|
||||
if (data.status === "Reject") {
|
||||
onSetPage({
|
||||
menuId: 2,
|
||||
status: data.status,
|
||||
});
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
if (data.status === "Peserta event") {
|
||||
router.push(RouterEvent.detail_main + data.appId, { scroll: false });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user