@neoimpulse/cap-js-notifications 1.0.5 → 1.0.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.
- package/package.json +1 -1
- package/srv/notifyToConsole.js +4 -4
- package/srv/notifyToRest.js +2 -3
package/package.json
CHANGED
package/srv/notifyToConsole.js
CHANGED
|
@@ -11,14 +11,14 @@ module.exports = class NotifyToConsole extends cds.Service {
|
|
|
11
11
|
|
|
12
12
|
this.on(eventsToListen, req => {
|
|
13
13
|
LOG._debug && LOG.debug('Handling notification event:', req.event)
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const message = data.message
|
|
14
|
+
const type = req.event
|
|
15
|
+
let message = req.data
|
|
17
16
|
message.type = type
|
|
17
|
+
message = buildNotification(message);
|
|
18
18
|
console.log (
|
|
19
19
|
'\n---------------------------------------------------------------\n' +
|
|
20
20
|
'Notification:', req.event,
|
|
21
|
-
|
|
21
|
+
message,
|
|
22
22
|
'\n---------------------------------------------------------------\n',
|
|
23
23
|
)
|
|
24
24
|
|
package/srv/notifyToRest.js
CHANGED
|
@@ -16,9 +16,8 @@ module.exports = exports = class NotifyToRest extends cds.Service {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async postNotification(req) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
let message = data.message
|
|
19
|
+
const type = req.event
|
|
20
|
+
let message = req.data
|
|
22
21
|
message.type = type
|
|
23
22
|
message = buildNotification(message);
|
|
24
23
|
|