$.ajax({
url: "/resource/support/create",
method: "POST",
data: {'subject': formData.get("subject"), 'message': formData.get("message")},
success: (response) => {
console.log("Before", response);
apiCallback(response, response => {
console.log("In", response)
document.location.href = response.data.url
})
},
});
if (data.success) {
successCallBack(); /// <== Сюда нужно передать
}
function apiCallback(data, successCallBack) {
if (data.success) {
successCallBack(data); //// <=== data
} else {
new ApiError(data.data);
}
}