Check userId set in sendUserNotification (#949)

This commit is contained in:
ekzyis 2024-03-21 01:59:48 +01:00 committed by GitHub
parent 889d494eaf
commit 01d779723f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,9 @@ const sendNotification = (subscription, payload) => {
async function sendUserNotification (userId, notification) {
try {
if (!userId) {
throw new Error('user id is required')
}
notification.data ??= {}
if (notification.item) {
notification.data.url ??= await createItemUrl(notification.item)