Commit 14d8c01b by Johannes Edmeier

Fix query for old flyway/liquibase endpoint format

parent 3bddd4eb
...@@ -26,7 +26,7 @@ module.exports = function ($scope, $http, application) { ...@@ -26,7 +26,7 @@ module.exports = function ($scope, $http, application) {
$scope.refresh = function () { $scope.refresh = function () {
$http.get('api/applications/' + application.id + '/flyway').then(function (response) { $http.get('api/applications/' + application.id + '/flyway').then(function (response) {
if (Array.isArray(response.data)) { if (Array.isArray(response.data) && (response.data.length === 0 || response.data[0].hasOwnProperty('name'))) {
$scope.reports = response.data; $scope.reports = response.data;
} else { } else {
$scope.reports = [{ name: 'flyway', migrations: response.data }]; $scope.reports = [{ name: 'flyway', migrations: response.data }];
...@@ -35,7 +35,7 @@ module.exports = function ($scope, $http, application) { ...@@ -35,7 +35,7 @@ module.exports = function ($scope, $http, application) {
}; };
$scope.refresh(); $scope.refresh();
$scope.inArray = function(migrationStatus, statusArray) { $scope.inArray = function (migrationStatus, statusArray) {
return statusArray.indexOf(migrationStatus) !== -1; return statusArray.indexOf(migrationStatus) !== -1;
}; };
}; };
...@@ -23,7 +23,7 @@ module.exports = function ($scope, $http, application) { ...@@ -23,7 +23,7 @@ module.exports = function ($scope, $http, application) {
$scope.refresh = function () { $scope.refresh = function () {
$http.get('api/applications/' + application.id + '/liquibase').then(function (response) { $http.get('api/applications/' + application.id + '/liquibase').then(function (response) {
if (Array.isArray(response.data)) { if (Array.isArray(response.data) && (response.data.length === 0 || response.data[0].hasOwnProperty('name'))) {
$scope.reports = response.data; $scope.reports = response.data;
} else { } else {
$scope.reports = [{ name: 'liqibase', changeLogs: response.data }]; $scope.reports = [{ name: 'liqibase', changeLogs: response.data }];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment