Skip to content

Commit

Permalink
add missing request methods on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 9, 2016
1 parent 9fa699e commit 48b8596
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion public/app/routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,26 @@ angular.module('fusioApp.routes', ['ngRoute', 'ui.bootstrap'])

$http.get(fusio_url + 'backend/routes/' + route.id)
.success(function(data){
$scope.route = data;
// check and add missing methods
if (data.config) {
var config = [];
for (var version in data.config) {
var ver = data.config[version];
var methods = {};
for (var i = 0; i < $scope.methods.length; i++) {
if (ver.methods.hasOwnProperty($scope.methods[i])) {
methods[$scope.methods[i]] = ver.methods[$scope.methods[i]];
} else {
methods[$scope.methods[i]] = {};
}
}
ver.methods = methods;
config.push(ver);
}
data.config = config;
}

$scope.route = data;
});

$http.get(fusio_url + 'backend/action')
Expand Down

0 comments on commit 48b8596

Please sign in to comment.