B4BY.588
Home
Terminal
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
sportmx
/
public_html
/
wp-content
/
plugins
/
wp-smushit
/
_src
/
react
/
utils
/
Filename :
request.js
back
Copy
import $ from 'jquery'; import ajaxUrl from 'ajaxUrl'; export function post(action, nonce, data = {}) { return new Promise(function (resolve, reject) { const request = Object.assign({}, { action: action, _ajax_nonce: nonce }, data); $.post(ajaxUrl, request) .done((response) => { if (response.success) { resolve( response?.data ); } else { reject(response?.data?.message); } }) .fail(() => reject()); }); }