mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 13:56:30 +00:00
Refactor deletion of multiple manufacturer part objects
- issues multiple DELETE requests via the API
This commit is contained in:
@ -123,8 +123,8 @@
|
||||
});
|
||||
|
||||
// Wait for *all* the requests to complete
|
||||
$.when.apply($, requests).then(function() {
|
||||
$('#bom-table').bootstrapTable('refresh');
|
||||
$.when(requests).then(function() {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -60,17 +60,10 @@
|
||||
|
||||
var selections = $("#manufacturer-table").bootstrapTable("getSelections");
|
||||
|
||||
var parts = [];
|
||||
|
||||
selections.forEach(function(item) {
|
||||
parts.push(item.pk);
|
||||
});
|
||||
|
||||
launchModalForm("{% url 'manufacturer-part-delete' %}", {
|
||||
data: {
|
||||
parts: parts,
|
||||
},
|
||||
reload: true,
|
||||
deleteManufacturerParts(selections, {
|
||||
onSuccess: function() {
|
||||
$("#manufacturer-table").bootstrapTable("refresh");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -80,7 +73,7 @@
|
||||
{
|
||||
params: {
|
||||
part: {{ part.id }},
|
||||
part_detail: false,
|
||||
part_detail: true,
|
||||
manufacturer_detail: true,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user