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([
40
40
element = $ ( '#' + this . options . elementId ) ,
41
41
self = this ,
42
42
params = { } ,
43
- msg = '' ;
43
+ msg = '' ,
44
+ fieldToCheck = this . options . fieldToCheck || 'success' ;
44
45
45
46
element . removeClass ( 'success' ) . addClass ( 'fail' ) ;
46
47
$ . each ( $ . parseJSON ( this . options . fieldMapping ) , function ( key , el ) {
@@ -49,9 +50,10 @@ define([
49
50
$ . ajax ( {
50
51
url : this . options . url ,
51
52
showLoader : true ,
52
- data : params
53
+ data : params ,
54
+ headers : this . options . headers || { }
53
55
} ) . done ( function ( response ) {
54
- if ( response . success ) {
56
+ if ( response [ fieldToCheck ] ) {
55
57
element . removeClass ( 'fail' ) . addClass ( 'success' ) ;
56
58
result = self . options . successText ;
57
59
} else {
You can’t perform that action at this time.
0 commit comments