include credentials in ajax-call

This commit is contained in:
Felix Hamann 2018-04-10 21:54:12 +02:00
parent 040abcab08
commit f99c8b3b86

View File

@ -23,8 +23,8 @@
event.preventDefault();
var url = new URL(window.location.origin + window.location.pathname + this.getAttribute('href'));
var order = this.parentNode.dataset.order || ASC;
// TODO: not working here... getting whole page as response...
url.searchParams.set('table-only', 'true');
// TODO: make use of dbtIdent instead of -terms-
url.searchParams.set('terms-table-only', 'true');
updateTableFrom(url);
markSorted(this.parentNode, order);
}
@ -40,6 +40,7 @@
// fetches new sorted table from url with params and replaces contents of current table
function updateTableFrom(url) {
fetch(url, {
credentials: 'same-origin',
headers: {
'Accept': 'text/html'
}