File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/code/Magento/AdvancedSearch/view/adminhtml/web/js Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ define([
4040 element = $ ( '#' + this . options . elementId ) ,
4141 self = this ,
4242 params = { } ,
43- msg = '' ;
43+ msg = '' ,
44+ fieldToCheck = this . options . fieldToCheck || 'success' ;
4445
4546 element . removeClass ( 'success' ) . addClass ( 'fail' ) ;
4647 $ . each ( $ . parseJSON ( this . options . fieldMapping ) , function ( key , el ) {
@@ -49,9 +50,10 @@ define([
4950 $ . ajax ( {
5051 url : this . options . url ,
5152 showLoader : true ,
52- data : params
53+ data : params ,
54+ headers : this . options . headers || { }
5355 } ) . done ( function ( response ) {
54- if ( response . success ) {
56+ if ( response [ fieldToCheck ] ) {
5557 element . removeClass ( 'fail' ) . addClass ( 'success' ) ;
5658 result = self . options . successText ;
5759 } else {
You can’t perform that action at this time.
0 commit comments