Skip to content

Commit

Permalink
no images info request when images array is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Mar 4, 2019
1 parent 3e1c856 commit feb8d68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/resources/dist/js/main.uglified.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/resources/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ zaa.factory("ServiceImagesData", ['$http', '$q', '$rootScope', '$log', function(

service.loadImages = function(imagesArray) {
return $q(function(resolve, reject) {
if (imagesArray.length == 0) {
return resolve();
}
$http.post('admin/api-admin-storage/images-info?expand=source,tinyCropImage', {ids: imagesArray}).then(function(response) {
angular.forEach(response.data, function(value) {
service.data[value.id] = value;
Expand Down

0 comments on commit feb8d68

Please sign in to comment.