From 4a0e615d7daffa1fcc18c35507ff6ce935d6ca45 Mon Sep 17 00:00:00 2001 From: ekzyis <27162016+ekzyis@users.noreply.github.com> Date: Mon, 28 Aug 2023 14:16:34 +0200 Subject: [PATCH] Fix TypeError during push notifications (#448) Without this, following error is thrown when notifying users about new replies: [webPush] error sending user notification: TypeError: Cannot read properties of undefined (reading 'id') app | at createItemUrl (webpack-internal:///(api)/./api/webPush/index.js:76:29) app | at async sendUserNotification (webpack-internal:///(api)/./api/webPush/index.js:125:33) app | at async Promise.allSettled (index 0) Co-authored-by: ekzyis --- api/resolvers/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 29e0677c..1cf17a2d 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -684,7 +684,7 @@ export default { parents.map(({ userId }) => sendUserNotification(userId, { title: `@${user.name} replied to you`, body: item.text, - item, + item: rItem, tag: 'REPLY' })) )