2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00
* Add basic endpoint for group information

* Add hardcoded api-url lookup function for django models

* Adds JS function for rendering a 'group'

* Fix typo

* Add unit tests for new endpoints

* Increment API version

* JS linting
This commit is contained in:
Oliver
2023-02-11 07:09:59 +11:00
committed by GitHub
parent 06605e70c5
commit f4e8c05165
8 changed files with 147 additions and 8 deletions

View File

@ -11,6 +11,7 @@
modalShowSubmitButton,
renderBuild,
renderCompany,
renderGroup,
renderManufacturerPart,
renderOwner,
renderPart,
@ -2073,6 +2074,9 @@ function renderModelData(name, model, data, parameters, options) {
case 'user':
renderer = renderUser;
break;
case 'group':
renderer = renderGroup;
break;
default:
break;
}

View File

@ -8,6 +8,7 @@
/* exported
renderBuild,
renderCompany,
renderGroup,
renderManufacturerPart,
renderOwner,
renderPart,
@ -15,6 +16,7 @@
renderStockItem,
renderStockLocation,
renderSupplierPart,
renderUser,
*/
@ -216,6 +218,17 @@ function renderPart(name, data, parameters={}, options={}) {
return html;
}
// Renderer for "Group" model
// eslint-disable-next-line no-unused-vars
function renderGroup(name, data, parameters={}, options={}) {
var html = `<span>${data.name}</span>`;
return html;
}
// Renderer for "User" model
// eslint-disable-next-line no-unused-vars
function renderUser(name, data, parameters={}, options={}) {