streamby-core 0.26.5 → 0.26.6
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.
|
@@ -46,6 +46,20 @@ function notificationRouter(config) {
|
|
|
46
46
|
res.status(500).json({ message: 'Failed to fetch notifications', details: err.message });
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
router.get('/notifications/:id', async (req, res) => {
|
|
50
|
+
try {
|
|
51
|
+
const auth = req.auth;
|
|
52
|
+
const { id } = req.params;
|
|
53
|
+
const notifications = (0, manager_1.getModel)('notifications', 'nosql');
|
|
54
|
+
const notification = await notifications.findOne({ _id: new mongodb_1.ObjectId(id), userId: auth.userId.toString() });
|
|
55
|
+
res.status(200).json({
|
|
56
|
+
data: notification,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
res.status(500).json({ message: 'Failed to fetch notifications', details: err.message });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
49
63
|
router.patch('/notifications/read-all', async (req, res) => {
|
|
50
64
|
try {
|
|
51
65
|
const auth = req.auth;
|