fix: Up and downvote puttons
This commit is contained in:
		@@ -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() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user