upd: notif insert
Deskripsi: - mengganti kalimat notifikasi sesuai dengan content yg diinputkan - upd api version No Issues
This commit is contained in:
@@ -119,11 +119,13 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
tokenDup.push(perbekel?.TokenDeviceUser.map((v: any) => v.token).flat())
|
||||
}
|
||||
|
||||
const commentNotif = comment.length > 300 ? comment.substring(0, 300) + '...' : comment;
|
||||
|
||||
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
||||
await sendFCMNotificationMany({
|
||||
token: tokenUnique,
|
||||
title: "Komentar Baru",
|
||||
body: `${userSent?.name}: ${comment}`,
|
||||
body: `${userSent?.name}: ${commentNotif}`,
|
||||
data: { id: data.id, category: `division/${dataDivision?.idDivision}/discussion`, content: id }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user