Last active
November 27, 2020 14:00
-
-
Save adhadse/13b200d882e1c55332163b394cf6dcda to your computer and use it in GitHub Desktop.
updateUserWihslist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateUserWishlist(productID,action){ | |
console.log('user:',user,' is Authenticated, sending data') | |
let url= '/api/update_wishlist/' | |
fetch(url,{ | |
method:'PUT', | |
headers:{ | |
'Content-Type':'application/json', | |
'X-CSRFToken':csrftoken, | |
}, | |
body:JSON.stringify({'productID':productID, 'action':action}) | |
}).then((response)=> | |
response.json() | |
).then(function (data){ | |
console.log('data:',data) | |
updateNavbar(data) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment