free-be-account 0.0.34 → 0.0.35

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/index.js CHANGED
@@ -1791,7 +1791,7 @@ module.exports = (app) => ({
1791
1791
  return;
1792
1792
  }
1793
1793
 
1794
- app.models.system_notification.create({
1794
+ return app.models.system_notification.create({
1795
1795
  User: user,
1796
1796
  Title: title,
1797
1797
  Content: content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-be-account",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -58,4 +58,37 @@ router.put('/read/:id',
58
58
  router.UpdateDocument('system_notification'),
59
59
  );
60
60
 
61
+ // read all
62
+ router.put('/read',
63
+ (req, res, next) => {
64
+ res.locals.filter = {
65
+ User: req.user.id,
66
+ Read: false,
67
+ };
68
+
69
+ res.locals.fields = [
70
+ 'Read',
71
+ ]
72
+
73
+ res.locals.body = {
74
+ Read: true,
75
+ };
76
+
77
+ return next();
78
+ },
79
+ router.UpdateDocuments('system_notification'),
80
+ );
81
+
82
+ router.delete('/:id',
83
+ (req, res, next) => {
84
+ res.locals.filter = {
85
+ id: req.params.id,
86
+ User: req.user.id,
87
+ };
88
+
89
+ return next();
90
+ },
91
+ router.DeleteDocument('system_notification'),
92
+ );
93
+
61
94
  module.exports = router;