Fixed api error handler for nsr delete
[osm/UI.git] / skyquake / plugins / launchpad / routes.js
index d8f6493..06ee5da 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -41,7 +41,7 @@ app.get('/api/nsr', cors(), function(req, res) {
         launchpadAPI['nsr'].delete(req).then(function(response) {
             utils.sendSuccessResponse(response, res);
         }, function(error) {
         launchpadAPI['nsr'].delete(req).then(function(response) {
             utils.sendSuccessResponse(response, res);
         }, function(error) {
-            sendErrorResponse(error, res);
+            utils.sendErrorResponse(error, res);
         });
     });
     app.post('/api/nsr', cors(), function(req, res) {
         });
     });
     app.post('/api/nsr', cors(), function(req, res) {
@@ -160,6 +160,13 @@ app.get('/api/nsr', cors(), function(req, res) {
             utils.sendErrorResponse(error, res);
         })
     });
             utils.sendErrorResponse(error, res);
         })
     });
+    app.get('/api/vnfr/:vnfr_id/vdur/:vdur_id/console-url', function(req, res) {
+        launchpadAPI['vdur']['consoleUrl'].get(req).then(function(data) {
+            utils.sendSuccessResponse(data, res);
+        }, function(error) {
+            utils.sendErrorResponse(error, res);
+        });
+    })
     app.get('/api/catalog', cors(), function(req, res) {
         launchpadAPI['catalog'].get(req).then(function(data) {
             utils.sendSuccessResponse(data, res);
     app.get('/api/catalog', cors(), function(req, res) {
         launchpadAPI['catalog'].get(req).then(function(data) {
             utils.sendSuccessResponse(data, res);