diff --git a/InvenTree/InvenTree/static/script/inventree/api.js b/InvenTree/InvenTree/static/script/inventree/api.js index 0a3b8d9374..52aba80ef5 100644 --- a/InvenTree/InvenTree/static/script/inventree/api.js +++ b/InvenTree/InvenTree/static/script/inventree/api.js @@ -108,6 +108,25 @@ function inventreePut(url, data={}, options={}) { if (options.error) { options.error(xhr, ajaxOptions, thrownError); } + }, + complete: function(xhr, status) { + if (options.complete) { + options.complete(xhr, status); + } } }); } + + +function inventreeDelete(url, options={}) { + /* + * Delete a record + */ + + options = options || {}; + + options.method = 'DELETE'; + + inventreePut(url, {}, options); + +} \ No newline at end of file