1<button class="delete-button" onclick="deleting(<%= item._id %>)">X</button>
2function deleting(value){
3fetch('/delete', { method: 'POST', data: {buttonId: value} })
4 .then(function (response) {
5 if (response.ok) {
6 console.log('Delete was recorded')
7 return
8 }
9 throw new Error('Request failed.')
10 })
11 .catch(function (error) {
12 console.log(error)
13 })
14