1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 11:22:42 +01:00

Allow customer options in fsAjax function

This commit is contained in:
FreeScout 2021-03-16 10:24:37 -07:00
parent f13a201c56
commit 3fe95f4362

12
public/js/main.js vendored
View File

@ -779,7 +779,7 @@ function multiInputInit()
} );
}
function fsAjax(data, url, success_callback, no_loader, error_callback)
function fsAjax(data, url, success_callback, no_loader, error_callback, custom_options)
{
if (!url) {
console.log('Empty URL');
@ -808,14 +808,20 @@ function fsAjax(data, url, success_callback, no_loader, error_callback)
}
}
$.ajax({
var options = {
url: url,
method: 'post',
dataType: 'json',
data: data,
success: success_callback,
error: error_callback
});
};
if (typeof(custom_options) == "object") {
options = {...options, ...custom_options};
}
$.ajax(options);
}
// Show loader