Deskripsi:
- Realtime notifikasi
## No Issue
This commit is contained in:
2024-07-24 10:14:07 +08:00
parent 73c6d58eef
commit 6553f6163f
25 changed files with 510 additions and 289 deletions

View File

@@ -8,10 +8,14 @@ export default async function adminNotifikasi_getByUserId() {
const adminId = await user_getOneUserId();
const data = await prisma.notifikasi.findMany({
orderBy: {
createdAt: "desc",
},
orderBy: [
{
isRead: "asc",
},
{
createdAt: "desc",
},
],
where: {
adminId: adminId,
userRoleId: "2",

View File

@@ -0,0 +1,27 @@
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
export async function adminNotifikasi_findRouterVoting({
data,
router,
onChangeNavbar,
onToggleNavbar,
}: {
data: MODEL_NOTIFIKASI;
router: AppRouterInstance;
onChangeNavbar: (val: any) => void;
onToggleNavbar: (val: any) => void;
}) {
const path = RouterAdminVote.table_review;
if (data.status === "Review") {
router.push(path, { scroll: false });
onChangeNavbar({
id: 5,
childId: 53,
});
}
onToggleNavbar(true);
}