add inventreeDelete ajax function

This commit is contained in:
Oliver Walters 2020-09-13 00:39:25 +10:00
parent 36ac268b96
commit 7a7db97914

View File

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