@timardex/cluemart-server-shared 1.0.291 → 1.0.292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/service/index.cjs +7 -5
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +6 -2
- package/dist/service/index.d.ts +6 -2
- package/dist/service/index.mjs +7 -5
- package/dist/service/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/service/index.cjs
CHANGED
|
@@ -9853,14 +9853,16 @@ async function notifyUsers({
|
|
|
9853
9853
|
try {
|
|
9854
9854
|
await sendPushNotifications(payload);
|
|
9855
9855
|
const uniqueUserIds = await saveNotificationsInDb(payload);
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9856
|
+
const persisted = payload.userIds.length === 0 || uniqueUserIds.length > 0;
|
|
9857
|
+
if (pubsub) {
|
|
9858
|
+
for (const userId of uniqueUserIds) {
|
|
9859
|
+
await publishNotificationEvents(userId, pubsub);
|
|
9860
|
+
}
|
|
9861
9861
|
}
|
|
9862
|
+
return persisted;
|
|
9862
9863
|
} catch (error) {
|
|
9863
9864
|
console.error("Error in notifyUsers:", error);
|
|
9865
|
+
return false;
|
|
9864
9866
|
}
|
|
9865
9867
|
}
|
|
9866
9868
|
|