Skip to content

Instantly share code, notes, and snippets.

@adhadse
Last active November 27, 2020 14:00
Show Gist options
  • Save adhadse/13b200d882e1c55332163b394cf6dcda to your computer and use it in GitHub Desktop.
Save adhadse/13b200d882e1c55332163b394cf6dcda to your computer and use it in GitHub Desktop.
updateUserWihslist
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