@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/index.cjs
CHANGED
|
@@ -9904,14 +9904,16 @@ async function notifyUsers({
|
|
|
9904
9904
|
try {
|
|
9905
9905
|
await sendPushNotifications(payload);
|
|
9906
9906
|
const uniqueUserIds = await saveNotificationsInDb(payload);
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9907
|
+
const persisted = payload.userIds.length === 0 || uniqueUserIds.length > 0;
|
|
9908
|
+
if (pubsub) {
|
|
9909
|
+
for (const userId of uniqueUserIds) {
|
|
9910
|
+
await publishNotificationEvents(userId, pubsub);
|
|
9911
|
+
}
|
|
9912
9912
|
}
|
|
9913
|
+
return persisted;
|
|
9913
9914
|
} catch (error) {
|
|
9914
9915
|
console.error("Error in notifyUsers:", error);
|
|
9916
|
+
return false;
|
|
9915
9917
|
}
|
|
9916
9918
|
}
|
|
9917
9919
|
|