mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Use the new 'mixin' filter to simplify request of label printer plugins
This commit is contained in:
parent
26f32a0ce8
commit
256af802e2
@ -236,17 +236,13 @@ function selectLabel(labels, items, options={}) {
|
|||||||
if (plugins_enabled) {
|
if (plugins_enabled) {
|
||||||
inventreeGet(
|
inventreeGet(
|
||||||
`/api/plugin/`,
|
`/api/plugin/`,
|
||||||
{},
|
{
|
||||||
|
mixin: 'labels',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
async: false,
|
async: false,
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
response.forEach(function(plugin) {
|
plugins = response;
|
||||||
// Look for active plugins which implement the 'labels' mixin class
|
|
||||||
if (plugin.active && plugin.mixins && plugin.mixins.labels) {
|
|
||||||
// This plugin supports label printing
|
|
||||||
plugins.push(plugin);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user