diff --git a/src/main/resources/static/main.js b/src/main/resources/static/main.js index e168ef4..a0810a8 100644 --- a/src/main/resources/static/main.js +++ b/src/main/resources/static/main.js @@ -121,13 +121,19 @@ export function vote(entryID, up) { baseURL, ); console.log(fetchURL); // TODO: remove - fetch(fetchURL, {method: "post", mode: 'no-cors'}); - /*.then(resp => resp.json()) // TODO: wait for backend - .then((data) => { - console.log(data.content); // TODO: remove*/ - let dataset = document.querySelector('[data-id= ' + CSS.escape(entryID) + ']') - dataset.querySelector("span").innerText++; // TODO: replace by parsed vote - /*});*/ + fetch(fetchURL, { + method: "PUT", //mode: 'no-cors' + headers: { + 'Content-Type': 'application/json', + // Add other headers as needed + }, + }); + /*.then(resp => resp.json()) // TODO: wait for backend + .then((data) => { + console.log(data.content); // TODO: remove*/ + let dataset = document.querySelector('[data-id= ' + CSS.escape(entryID) + ']') + dataset.querySelector("span").innerText++; // TODO: replace by parsed vote + /*});*/ } function incrementPageCount() {