2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Don't render full category information in part API

- Lots of data duplication!
- Just send the category ID (and the category name)
-
This commit is contained in:
Oliver Walters
2019-04-15 22:52:53 +10:00
parent ac0b28a06c
commit 3d9a1acc2e
3 changed files with 5 additions and 4 deletions

View File

@@ -151,11 +151,11 @@
},
{
sortable: true,
field: 'category',
field: 'category_name',
title: 'Category',
formatter: function(value, row, index, field) {
if (row.category) {
return renderLink(row.category.pathstring, row.category.url);
return renderLink(row.category_name, "/part/category/" + row.category + "/");
}
else {
return '';

View File

@@ -4,7 +4,7 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse1">Child Categories</a><span class='badge'>{{ children|length }}</span>
<a data-toggle="collapse" href="#collapse1">{{ children | length }} Child Categories</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">