mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
First commit
This commit is contained in:
32
views/quantityunits.js
Normal file
32
views/quantityunits.js
Normal file
@@ -0,0 +1,32 @@
|
||||
$(document).on('click', '.quantityunit-delete-button', function(e)
|
||||
{
|
||||
bootbox.confirm({
|
||||
message: 'Delete quantity unit <strong>' + $(e.target).attr('data-quantityunit-name') + '</strong>?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Yes',
|
||||
className: 'btn-success'
|
||||
},
|
||||
cancel: {
|
||||
label: 'No',
|
||||
className: 'btn-danger'
|
||||
}
|
||||
},
|
||||
callback: function(result)
|
||||
{
|
||||
if (result == true)
|
||||
{
|
||||
Grocy.FetchJson('/api/delete-object/quantity_units/' + $(e.target).attr('data-quantityunit-id'),
|
||||
function(result)
|
||||
{
|
||||
window.location.href = '/quantityunits';
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user