upd: notifikasi data

Deskripsi:
- filter data iduser = undefined

No Issues
This commit is contained in:
2025-08-28 14:06:56 +08:00
parent 3bbfadb45e
commit e5eb2e1cc2
5 changed files with 7 additions and 1 deletions

View File

@@ -209,6 +209,8 @@ export async function POST(request: Request) {
})
}
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
const insertNotif = await prisma.notifications.createMany({
data: dataNotif
})

View File

@@ -260,6 +260,8 @@ 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)
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: 'Terdapat diskusi baru. Silahkan periksa detailnya.', title: 'Diskusi Baru' } })

View File

@@ -313,6 +313,7 @@ export async function POST(request: Request) {
tokenDup.push(...omitFCM.map((v: any) => v.tokens).flat())
}
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

@@ -355,6 +355,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)
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: 'Terdapat tugas baru. Silahkan periksa detailnya.', title: 'Tugas Baru' } })