Merge pull request 'upd : data notif kosong' (#24) from amalia/28-agustus-25 into join

Reviewed-on: bip/sistem-desa-mandiri#24
This commit is contained in:
2025-08-28 15:11:28 +08:00
4 changed files with 7 additions and 1 deletions

View File

@@ -254,6 +254,7 @@ export async function POST(request: Request) {
}
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
const pushNotif = dataPush.filter((item) => item.subscription != undefined)

View File

@@ -517,6 +517,8 @@ export async function GET(request: Request) {
desc: `Tugas dengan deadline ${moment(v.dateEnd).format('DD-MM-yyyy')} telah berakhir. Silakan segera melakukan tindakan yang diperlukan.`
}))
pertama.filter((item) => item.idUserTo != undefined && item.idUserTo != null && item.idUserTo != "" && item.idUserTo != user.id)
const insertNotif = await prisma.notifications.createMany({
data: pertama
})
@@ -576,6 +578,8 @@ export async function GET(request: Request) {
desc: `Tugas dengan deadline ${moment(v.dateEnd).format('DD-MM-yyyy')} telah berakhir. Silakan segera melakukan tindakan yang diperlukan.`
}))
kedua.filter((item) => item.idUserTo != undefined && item.idUserTo != null && item.idUserTo != "" && item.idUserTo != user.id)
const insertNotif2 = await prisma.notifications.createMany({
data: kedua
})

View File

@@ -384,6 +384,7 @@ export async function POST(request: Request) {
tokenDup.push(...omitFCM.map((v: any) => v.tokens).flat())
}
dataNotif.filter((item) => item.idUserTo != undefined && item.idUserTo != null && item.idUserTo != "" && item.idUserTo != userId)
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Kegiatan Baru', body: 'Terdapat kegiatan baru. Silahkan periksa detailnya.' } })

View File

@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
export async function GET(request: Request) {
try {
return NextResponse.json({ success: true, version: "1.7.2", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
return NextResponse.json({ success: true, version: "1.7.3", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
} catch (error) {
console.error(error);
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });