dewrich closed pull request #2089: Makes api calls for ds requests using query 
params instead of route p…
URL: https://github.com/apache/incubator-trafficcontrol/pull/2089
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js 
b/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
index edcff0f8b..dd00ced0f 100644
--- a/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
+++ b/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
@@ -43,7 +43,7 @@ var DeliveryServiceRequestService = function(Restangular, 
$http, $q, locationUti
        this.updateDeliveryServiceRequest = function(id, dsRequest) {
                var request = $q.defer();
 
-               $http.put(ENV.api['root'] + "deliveryservice_requests/" + id, 
dsRequest)
+               $http.put(ENV.api['root'] + "deliveryservice_requests?id=" + 
id, dsRequest)
                        .then(
                                function() {
                                        request.resolve();
@@ -58,16 +58,20 @@ var DeliveryServiceRequestService = function(Restangular, 
$http, $q, locationUti
        };
 
        this.deleteDeliveryServiceRequest = function(id, delay) {
-               return Restangular.one("deliveryservice_requests", id).remove()
+               var deferred = $q.defer();
+
+               $http.delete(ENV.api['root'] + "deliveryservice_requests?id=" + 
id)
                        .then(
-                               function() {
-                                       messageModel.setMessages([ { level: 
'success', text: 'Delivery service request deleted' } ], delay);
-                                       
locationUtils.navigateToPath('/delivery-service-requests');
+                               function(response) {
+                                       deferred.resolve(response);
                                },
                                function(fault) {
                                        
messageModel.setMessages(fault.data.alerts, false);
+                                       deferred.reject(fault);
                                }
                        );
+
+               return deferred.promise;
        };
 
        this.assignDeliveryServiceRequest = function(id, userId) {
@@ -127,7 +131,7 @@ var DeliveryServiceRequestService = function(Restangular, 
$http, $q, locationUti
        this.updateDeliveryServiceRequestComment = function(comment) {
                var request = $q.defer();
 
-               $http.put(ENV.api['root'] + "deliveryservice_request_comments/" 
+ comment.id, comment)
+               $http.put(ENV.api['root'] + 
"deliveryservice_request_comments?id=" + comment.id, comment)
                        .then(
                                function() {
                                        request.resolve();
@@ -144,7 +148,7 @@ var DeliveryServiceRequestService = function(Restangular, 
$http, $q, locationUti
        this.deleteDeliveryServiceRequestComment = function(comment) {
                var deferred = $q.defer();
 
-               $http.delete(ENV.api['root'] + 
"deliveryservice_request_comments/" + comment.id)
+               $http.delete(ENV.api['root'] + 
"deliveryservice_request_comments?id=" + comment.id)
                        .then(
                                function(response) {
                                        deferred.resolve(response);
diff --git 
a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
 
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
index 3692f5947..ac6a90253 100644
--- 
a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
+++ 
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
@@ -307,8 +307,9 @@ var TableDeliveryServicesRequestsController = 
function(dsRequests, $scope, $stat
                        }
                });
                modalInstance.result.then(function() {
-                       
deliveryServiceRequestService.deleteDeliveryServiceRequest(request.id, false).
+                       
deliveryServiceRequestService.deleteDeliveryServiceRequest(request.id).
                                then(function() {
+                                       messageModel.setMessages([ { level: 
'success', text: 'Delivery service request deleted' } ], false);
                                        $scope.refresh();
                                });
                }, function () {
diff --git 
a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
 
b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
index d1c19e33e..79ed64d14 100644
--- 
a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
+++ 
b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
@@ -247,7 +247,11 @@ var FormEditDeliveryServiceRequestController = 
function(deliveryServiceRequest,
                        }
                });
                modalInstance.result.then(function() {
-                       
deliveryServiceRequestService.deleteDeliveryServiceRequest($stateParams.deliveryServiceRequestId,
 true);
+                       
deliveryServiceRequestService.deleteDeliveryServiceRequest($stateParams.deliveryServiceRequestId).
+                               then(function() {
+                                       messageModel.setMessages([ { level: 
'success', text: 'Delivery service request deleted' } ], true);
+                                       
locationUtils.navigateToPath('/delivery-service-requests');
+                               });
                }, function () {
                        // do nothing
                });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to