Skip to content

Instantly share code, notes, and snippets.

@julientaq
Last active May 16, 2020 14:40
Show Gist options
  • Save julientaq/deb18e391e59109473313238a33d0e5c to your computer and use it in GitHub Desktop.
Save julientaq/deb18e391e59109473313238a33d0e5c to your computer and use it in GitHub Desktop.
async function acceptOne(id, el) {
axios
.put(`${server}/participants/${id}`, JSON.stringify('"accept": true'), {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then(function (response) {
console.log("ok");
console.log('response', response)
el.closest(".p").remove();
// document.querySelector("section.updat").innerHTML = '<p class="thanks">Welcome to the band! We’ll add your name to the list.</p>';
})
.catch(error => {
console.log(error);
});
}
async function refuseOne(id, el) {
axios
.put(`${server}/participants/${id}`, JSON.stringify('"accept": "false"'), {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then(function (response) {
console.log("ok");
console.log('response', response)
el.closest(".p").remove();
// document.querySelector("section.updat").innerHTML = '<p class="thanks">Welcome to the band! We’ll add your name to the list.</p>';
})
.catch(error => {
console.log(error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment