## Deskripsi:
- Perubahan tampilan notifikasi
- Pin map sesuai logo
- Pin map bisa custom
### No Issue
This commit is contained in:
2024-08-23 14:15:11 +08:00
parent cae318c5e3
commit a6bb993b0d
75 changed files with 1602 additions and 646 deletions

View File

@@ -0,0 +1,17 @@
"use server";
import { funGlobal_getMasterKategoriApp } from "@/app_modules/_global/fun/get";
export async function notifikasi_funGetKategoriApp() {
const data = await funGlobal_getMasterKategoriApp();
data.unshift({
id: "0",
isActive: true,
createdAt: new Date(),
updatedAt: new Date(),
name: "Semua",
value: null,
});
return data;
}

View File

@@ -2,17 +2,39 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
import _ from "lodash";
export default async function notifikasi_getByUserId({
page,
kategoriApp,
}: {
page: number;
kategoriApp?: string;
}) {
const userId = await user_getOneUserId();
const takeData = 10;
const skipData = page * takeData - takeData;
const data = await prisma.notifikasi.findMany({
if (kategoriApp === "Semua") {
const data = await prisma.notifikasi.findMany({
take: takeData,
skip: skipData,
orderBy: [
{
isRead: "asc",
},
{ createdAt: "desc" },
],
where: {
userId: userId,
userRoleId: "1",
},
});
return data;
}
const allData = await prisma.notifikasi.findMany({
take: takeData,
skip: skipData,
orderBy: [
@@ -24,8 +46,9 @@ export default async function notifikasi_getByUserId({
where: {
userId: userId,
userRoleId: "1",
kategoriApp: _.upperCase(kategoriApp),
},
});
return data;
return allData;
}