refined main.js/vote() -> ready for receiving backend response
This commit is contained in:
parent
e9e825eb42
commit
ebb90632eb
@ -121,15 +121,13 @@ export function vote(entryID, up) {
|
|||||||
baseURL,
|
baseURL,
|
||||||
);
|
);
|
||||||
console.log(fetchURL); // TODO: remove
|
console.log(fetchURL); // TODO: remove
|
||||||
fetch(fetchURL, {
|
fetch(fetchURL, {method: "post", mode: 'no-cors'});
|
||||||
method: "post"
|
/*.then(resp => resp.json()) // TODO: wait for backend
|
||||||
})
|
|
||||||
.then(resp => resp.json())
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data.content); // TODO: remove
|
console.log(data.content); // TODO: remove*/
|
||||||
let dataset = document.querySelector('[data-id= ' + CSS.escape(entryID) + ']')
|
let dataset = document.querySelector('[data-id= ' + CSS.escape(entryID) + ']')
|
||||||
dataset.querySelector("span").innerText = -1; // TODO: replace by parsed vote
|
dataset.querySelector("span").innerText++; // TODO: replace by parsed vote
|
||||||
});
|
/*});*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function incrementPageCount() {
|
function incrementPageCount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user