PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | assets/src/js/utils/handle-ajax-api.js +21 -21 4.3.8 → 4.4.9 View file →
@@ -1,21 +1,21 @@
1 -const handleAjax = function( url, params, functions ) {
2 - wp.apiFetch( {
3 - path: url,
4 - method: 'POST',
5 - data: params,
6 - } ).then( ( res ) => {
7 - if ( 'function' === typeof functions.success ) {
8 - functions.success( res );
9 - }
10 - } ).catch( ( err ) => {
11 - if ( 'function' === typeof functions.error ) {
12 - functions.error( err );
13 - }
14 - } ).then( () => {
15 - if ( 'function' === typeof functions.completed ) {
16 - functions.completed();
17 - }
18 - } );
19 -};
20 -
21 -export default handleAjax;
1 +const handleAjax = function( url, params, functions ) {
2 + wp.apiFetch( {
3 + path: url,
4 + method: 'POST',
5 + data: params,
6 + } ).then( ( res ) => {
7 + if ( 'function' === typeof functions.success ) {
8 + functions.success( res );
9 + }
10 + } ).catch( ( err ) => {
11 + if ( 'function' === typeof functions.error ) {
12 + functions.error( err );
13 + }
14 + } ).then( () => {
15 + if ( 'function' === typeof functions.completed ) {
16 + functions.completed();
17 + }
18 + } );
19 +};
20 +
21 +export default handleAjax;