quick and dirty fix for delete
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
14a238d9a2
commit
3a5f8ed6d6
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user