#feat:
Deskripsi: - Realtime notifikasi ## No Issue
This commit is contained in:
@@ -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",
|
||||
|
||||
27
src/app_modules/admin/notifikasi/route_setting/voting.ts
Normal file
27
src/app_modules/admin/notifikasi/route_setting/voting.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user