diff --git a/app/components/images/imagesController.js b/app/components/images/imagesController.js index 50f43567e..76eac5564 100644 --- a/app/components/images/imagesController.js +++ b/app/components/images/imagesController.js @@ -71,15 +71,17 @@ function ($scope, $state, Config, Image, Messages) { if (i.Checked) { counter = counter + 1; Image.remove({id: i.Id}, function (d) { - angular.forEach(d, function (resource) { - Messages.send("Image deleted", resource.Deleted); - }); - var index = $scope.images.indexOf(i); - $scope.images.splice(index, 1); + if (d[0].message) { + $('#loadingViewSpinner').hide(); + Messages.error("Unable to remove image", d[0].message); + } else { + Messages.send("Image deleted", i.Id); + var index = $scope.images.indexOf(i); + $scope.images.splice(index, 1); + } complete(); }, function (e) { - Messages.error("Failure", e.data); - $('#loadImagesSpinner').hide(); + Messages.error("Unable to remove image", e.data); complete(); }); } diff --git a/gruntFile.js b/gruntFile.js index 86c2f3ebe..4af600813 100644 --- a/gruntFile.js +++ b/gruntFile.js @@ -152,11 +152,11 @@ module.exports = function (grunt) { } }, angular: { - src: ['bower_components/angular/angular.min.js', + src: ['bower_components/angular/angular.js', 'bower_components/angular-sanitize/angular-sanitize.min.js', 'bower_components/angular-cookies/angular-cookies.min.js', 'bower_components/angular-ui-router/release/angular-ui-router.min.js', - 'bower_components/angular-resource/angular-resource.min.js', + 'bower_components/angular-resource/angular-resource.js', 'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js', 'bower_components/angular-ui-select/dist/select.min.js'], dest: '<%= distdir %>/js/angular.js'