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

only one api call

This commit is contained in:
Matthias
2021-12-08 00:05:34 +01:00
parent 948270bbcb
commit 596532f312
3 changed files with 17 additions and 54 deletions

View File

@ -153,13 +153,7 @@ function enableSidetree(label) {
$('#tree').jstree({
'core': {
'data': {
'url': function(node) {
if (node.id == '#') {
var url_parts = String(window.location).split("/").slice(-3);
return `/api/part/category/tree/${url_parts[0]}/${url_parts[1]}/`;
}
return '/api/part/category/tree/'
},
'url': '/api/part/category/tree/',
'data': function(node) {
return {'id': node.id};
}