Last active
May 16, 2020 14:40
-
-
Save julientaq/deb18e391e59109473313238a33d0e5c to your computer and use it in GitHub Desktop.
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
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