![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-media-gallery-ui/view/adminhtml/web/js/action/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ 'jquery', 'mage/translate' ], function ($, $t) { 'use strict'; return function (imageDetailsUrl, imageIds) { var deferred = $.Deferred(), message; $.ajax({ type: 'GET', url: imageDetailsUrl, dataType: 'json', showLoader: true, data: { 'ids': imageIds }, context: this, /** * Resolve with image details if success, reject with response message othervise * * @param {Object} response */ success: function (response) { if (response.success) { deferred.resolve(response.imageDetails); return; } deferred.reject(response.message); }, /** * Extract the message and reject * * @param {Object} response */ error: function (response) { if (typeof response.responseJSON === 'undefined' || typeof response.responseJSON.message === 'undefined' ) { message = $t('Could not retrieve image details.'); } else { message = response.responseJSON.message; } deferred.reject(message); } }); return deferred.promise(); }; });