#feat:
Deskripsi: - Realtime notifikasi ## No Issue
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user