document.getElementById('storageUnitModalLocationSelectText').innerText="While editing you can only select already existing locations. Use the settings to create new ones.";
document.getElementById('storageUnitModalLabel').innerText="Edit a storage unit";
$('#generalToast').children('.d-flex').children('.toast-body').html('<i class="bi bi-exclamation-triangle-fill"></i> Something went wrong. The storageUnit does no longer exist.');
setTimeout(()=>{
window.location.reload();
},3000);
}
});
}
functiondeleteEntry(id){
$.ajax({
type:'delete',
url:`/api/v1/storageUnits`,
data:{id:id},
success:function(data){
$('#staticBackdrop').modal('hide');
normalizeToast()
$('#generalToast').addClass('text-bg-success');
$('#generalToast').toast('show');
$('#generalToast').children('.d-flex').children('.toast-body').html('<i class="bi bi-check2"></i> Storage Unit deleted successfully.');
confetti({
spread:360,
ticks:100,
gravity:0.1,
decay:0.94,
startVelocity:30,
particleCount:20,
scalar:2,
shapes:['text'],
shapeOptions:{
text:{
value:['❌','🗑️','🚫']
}
}
});
setTimeout(()=>{
$('#generalToast').toast('hide');
window.location.reload();
},2000);
},
error:function(data){
// hide the staticBackdrop modal
$('#staticBackdrop').modal('hide');
normalizeToast()
$('#generalToast').addClass('text-bg-danger');
$('#generalToast').toast('show');
$('#generalToast').children('.d-flex').children('.toast-body').html('<i class="bi bi-exclamation-triangle-fill"></i> Something went wrong. Please try again later.');
$('#generalToast').children('.d-flex').children('.toast-body').html('<i class="bi bi-exclamation-triangle-fill"></i> Something went wrong. The storage unit does no longer exist.');