Use the new 'mixin' filter to simplify request of label printer plugins

This commit is contained in:
Oliver Walters 2022-05-09 22:35:46 +10:00
parent 26f32a0ce8
commit 256af802e2

View File

@ -236,17 +236,13 @@ function selectLabel(labels, items, options={}) {
if (plugins_enabled) {
inventreeGet(
`/api/plugin/`,
{},
{
mixin: 'labels',
},
{
async: false,
success: function(response) {
response.forEach(function(plugin) {
// 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);
}
});
plugins = response;
}
}
);