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

@@ -3,17 +3,24 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export default async function notifikasi_getByUserId({page}: {page: number }) {
export default async function notifikasi_getByUserId({
page,
}: {
page: number;
}) {
const userId = await user_getOneUserId();
const takeData = 10;
const skipData = page * takeData - takeData;
const takeData = 10;
const skipData = page * takeData - takeData;
const data = await prisma.notifikasi.findMany({
take: takeData,
skip: skipData,
orderBy: {
isRead: "asc"
},
orderBy: [
{
isRead: "asc",
},
{ createdAt: "desc" },
],
where: {
userId: userId,
userRoleId: "1",