|
|
@ -49,14 +49,21 @@ export const Bucket = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const deleteObject = async id => {
|
|
|
|
const deleteObject = async id => {
|
|
|
|
|
|
|
|
if (!confirm(`Cancellare l'oggetto con id ${id} da questo bucket?`)) {
|
|
|
|
|
|
|
|
showToast(<ToastMessage icon="info">Operazione annullata</ToastMessage>)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const res = await fetch(`/api/buckets/${bucket}/${id}`, { method: 'DELETE' })
|
|
|
|
const res = await fetch(`/api/buckets/${bucket}/${id}`, { method: 'DELETE' })
|
|
|
|
|
|
|
|
|
|
|
|
if (res.ok) {
|
|
|
|
if (res.ok) {
|
|
|
|
showToast('Oggetto rimosso')
|
|
|
|
showToast(<ToastMessage icon="info">Oggetto rimosso</ToastMessage>)
|
|
|
|
|
|
|
|
|
|
|
|
await updateBucketObjects()
|
|
|
|
await updateBucketObjects()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
showToast(`Errore "${await res.text()}"`)
|
|
|
|
showToast(
|
|
|
|
|
|
|
|
<ToastMessage icon="error">Errore del server "{await res.text()}"</ToastMessage>
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|