quick and dirty fix for delete
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Sergo 2023-07-30 01:34:10 +03:00
parent 14a238d9a2
commit 3a5f8ed6d6

View File

@ -32,6 +32,19 @@ function renderAliases(aliases) {
tdCreated.innerText = alias.created
const tdActions = document.createElement('td')
const aDelete = document.createElement('a')
aDelete.addEventListener('click', async () => {
const res = await fetch(`/aliases/${alias.id}`, {
method: 'DELETE'
})
if (res.ok) {
const data = await res.json()
renderAliases(data)
return
}
})
aDelete.classList.add('btn')
aDelete.classList.add('btn-danger')
aDelete.innerText = 'Delete'