mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
fixed #900 - api calls hopefully no longer cached
This commit is contained in:
@@ -186,23 +186,27 @@
|
|||||||
parse_template();
|
parse_template();
|
||||||
}
|
}
|
||||||
|
|
||||||
apiXHR = jQuery.get(RELATIVE_PATH + '/api/' + api_url, function (data) {
|
apiXHR = $.ajax({
|
||||||
|
url: RELATIVE_PATH + '/api/' + api_url,
|
||||||
|
cache: false,
|
||||||
|
success: function (data) {
|
||||||
|
if (!data) {
|
||||||
|
ajaxify.go('404');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!data) {
|
template_data = data;
|
||||||
ajaxify.go('404');
|
parse_template();
|
||||||
return;
|
},
|
||||||
}
|
error: function (data, textStatus) {
|
||||||
|
$('#content, #footer').stop(true, true).removeClass('ajaxifying');
|
||||||
template_data = data;
|
if (data && data.status == 404) {
|
||||||
parse_template();
|
return ajaxify.go('404');
|
||||||
}).fail(function (data, textStatus) {
|
} else if (data && data.status === 403) {
|
||||||
jQuery('#content, #footer').stop(true, true).removeClass('ajaxifying');
|
return ajaxify.go('403');
|
||||||
if (data && data.status == 404) {
|
} else if (textStatus !== "abort") {
|
||||||
return ajaxify.go('404');
|
app.alertError(data.responseJSON.error);
|
||||||
} else if (data && data.status === 403) {
|
}
|
||||||
return ajaxify.go('403');
|
|
||||||
} else if (textStatus !== "abort") {
|
|
||||||
app.alertError(data.responseJSON.error);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user