We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 89ef66f + 5ee2f6e commit 979e46fCopy full SHA for 979e46f
1 file changed
assets/js/ajax-request.js
@@ -34,14 +34,19 @@ const progressPlannerAjaxRequest = ( {
34
return http.response;
35
}
36
37
- if ( http.readyState === 4 && http.status === 200 ) {
38
- return successAction
39
- ? successAction( response )
+
+ if ( http.readyState === 4 ) {
+ if ( http.status === 200 ) {
40
+ return successAction
41
+ ? successAction( response )
42
+ : defaultCallback( response );
43
+ }
44
45
+ // Request is completed, but the status is not 200.
46
+ return failAction
47
+ ? failAction( response )
48
: defaultCallback( response );
49
- return failAction
- ? failAction( response )
- : defaultCallback( response );
50
};
51
52
const dataForm = new FormData();
0 commit comments