From ee347c61652add845a350877b5bde399963ada78 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 5 May 2018 00:00:48 +1000 Subject: [PATCH] Further API calls - getStock - getStockLocation - getCompanies --- InvenTree/static/script/inventree/api.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/InvenTree/static/script/inventree/api.js b/InvenTree/static/script/inventree/api.js index 6f85291403..536430d4c8 100644 --- a/InvenTree/static/script/inventree/api.js +++ b/InvenTree/static/script/inventree/api.js @@ -11,7 +11,7 @@ function inventreeGet(url, filters={}) { error: function(xhr, ajaxOptions, thrownError) { console.error('Error on GET at ' + url); console.error(thrownError); - return {}; + return {error: thrownError}; } }) } @@ -24,4 +24,16 @@ function getParts(filters={}) { // Return list of part categories with optional filters function getPartCategories(filters={}) { return inventreeGet('/api/part/category/', filters); +} + +function getStock(filters={}) { + return inventreeGet('/api/stock/', filters); +} + +function getStockLocations(filters={}) { + return inventreeGet('/api/stock/location/', filters) +} + +function getCompanies(filters={}) { + return inventreeGet('/api/company/', filters); } \ No newline at end of file