2
0
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:
Oliver
2021-07-01 17:01:30 +10:00
parent 206d7bd96a
commit 9bd71c1184
6 changed files with 74 additions and 61 deletions

View File

@ -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();
});
}
}

View File

@ -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,
},
}