You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by be...@apache.org on 2017/07/13 18:55:01 UTC

[incubator-openwhisk-package-alarms] branch master updated: Return Expected JSON Response from Web Action (#73)

This is an automated email from the ASF dual-hosted git repository.

berstler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-alarms.git


The following commit(s) were added to refs/heads/master by this push:
     new b2717ea  Return Expected JSON Response from Web Action (#73)
b2717ea is described below

commit b2717ea3d27cb229ba20bf50fd02b8d8ab31c563
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Thu Jul 13 14:54:59 2017 -0400

    Return Expected JSON Response from Web Action (#73)
---
 action/alarmWebAction.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/action/alarmWebAction.js b/action/alarmWebAction.js
index 3458616..bc13019 100644
--- a/action/alarmWebAction.js
+++ b/action/alarmWebAction.js
@@ -53,7 +53,13 @@ function main(params) {
             .then(() => {
                  return createTrigger(db, triggerID, newTrigger);
             })
-            .then(resolve)
+            .then(() => {
+                resolve({
+                    statusCode: 200,
+                    headers: {'Content-Type': 'application/json'},
+                    body: new Buffer(JSON.stringify({'status': 'success'})).toString('base64'),
+                });
+            })
             .catch(err => {
                 reject(err);
             });
@@ -70,7 +76,13 @@ function main(params) {
             .then(id => {
                 return deleteTrigger(db, id, 0);
             })
-            .then(resolve)
+            .then(() => {
+                resolve({
+                    statusCode: 200,
+                    headers: {'Content-Type': 'application/json'},
+                    body: new Buffer(JSON.stringify({'status': 'success'})).toString('base64'),
+                });
+            })
             .catch(err => {
                 reject(err);
             });

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].