Server IP : 150.95.80.236 / Your IP : 3.145.96.224 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/assets/plugins/formvalidation/dist/amd/validators/ |
Upload File : |
define(["require", "exports", "../utils/fetch"], function (require, exports, fetch_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function remote() { var DEFAULT_OPTIONS = { crossDomain: false, data: {}, headers: {}, method: 'GET', validKey: 'valid', }; return { validate: function (input) { if (input.value === '') { return Promise.resolve({ valid: true, }); } var opts = Object.assign({}, DEFAULT_OPTIONS, input.options); var data = opts.data; if ('function' === typeof opts.data) { data = opts.data.call(this, input); } if ('string' === typeof data) { data = JSON.parse(data); } data[opts.name || input.field] = input.value; var url = 'function' === typeof opts.url ? opts.url.call(this, input) : opts.url; return (0, fetch_1.default)(url, { crossDomain: opts.crossDomain, headers: opts.headers, method: opts.method, params: data, }) .then(function (response) { return Promise.resolve({ message: response['message'], meta: response, valid: "" + response[opts.validKey] === 'true', }); }) .catch(function (_reason) { return Promise.reject({ valid: false, }); }); }, }; } exports.default = remote; });