2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Update upload file template

This commit is contained in:
Oliver
2022-02-07 12:25:09 +11:00
parent 131663cecc
commit 11d5900b69
2 changed files with 75 additions and 51 deletions

View File

@ -172,36 +172,22 @@ function submitBomTable(part_id, options={}) {
getApiEndpointOptions(url, function(response) {
var fields = response.actions.POST;
constructForm(url, {
inventreePut(url, data, {
method: 'POST',
fields: {
clear_existing: {},
},
title: '{% trans "Submit BOM Data" %}',
onSubmit: function(fields, opts) {
data.clear_existing = getFormFieldValue('clear_existing', {}, opts);
$(opts.modal).modal('hide');
inventreePut(url, data, {
method: 'POST',
success: function(response) {
// TODO: Return to the "bom" page
},
error: function(xhr) {
switch (xhr.status) {
case 400:
handleFormErrors(xhr.responseJSON, fields, options);
break;
default:
showApiError(xhr, url);
break;
}
}
});
success: function(response) {
window.location.href = `/part/${part_id}/?display=bom`;
},
error: function(xhr) {
switch (xhr.status) {
case 400:
handleFormErrors(xhr.responseJSON, fields, options);
break;
default:
showApiError(xhr, url);
break;
}
}
});
});
});
}