@neoimpulse/cap-js-notifications 1.0.4 → 1.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoimpulse/cap-js-notifications",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A CDS plugin to provide an easy action for the notification service",
5
5
  "main": "cds-plugin.js",
6
6
  "scripts": {
@@ -18,8 +18,10 @@ module.exports = exports = class NotifyToRest extends cds.Service {
18
18
  async postNotification(req) {
19
19
  const data = req.data;
20
20
  const type = data.type
21
- const message = data.message
21
+ let message = data.message
22
22
  message.type = type
23
+ message = buildNotification(message);
24
+
23
25
  const notificationDestination = await getNotificationDestination();
24
26
  const csrfHeaders = await buildHeadersForDestination(notificationDestination, {
25
27
  url: NOTIFICATIONS_API_ENDPOINT,
@@ -27,7 +29,7 @@ module.exports = exports = class NotifyToRest extends cds.Service {
27
29
 
28
30
  try {
29
31
  LOG._info && LOG.info(
30
- `Sending notification of key: ${notificationData.NotificationTypeKey} and version: ${notificationData.NotificationTypeVersion}`
32
+ `Sending notification of key: ${message.NotificationTypeKey} and version: ${message.NotificationTypeVersion}`
31
33
  );
32
34
  await executeHttpRequest(notificationDestination, {
33
35
  url: `${NOTIFICATIONS_API_ENDPOINT}/Notifications`,