Skip to content

Commit 2322fbe

Browse files
authored
Merge pull request #282 from shbatm/fix_identifiers
Fix Modules API when using Identifiers
2 parents 594a228 + 37992b2 commit 2322fbe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

API/api.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,16 @@ module.exports = {
344344
return;
345345
}
346346

347-
var modData = [];
347+
let modData = [];
348348
if(req.params.moduleName !== 'all') {
349-
let i = dataMerged.find(m => {
349+
modData = dataMerged.filter(m => {
350350
return (req.params.moduleName.includes(m.identifier));
351351
});
352-
if (!i) {
352+
if (!modData) {
353353
modData = dataMerged.filter(m => {
354354
return (req.params.moduleName.includes(m.name));
355355
});
356-
} else modData.push(i)
356+
}
357357
} else {
358358
modData = dataMerged;
359359
}
@@ -364,7 +364,7 @@ module.exports = {
364364
}
365365

366366
if (!req.params.action) {
367-
res.json({ success: true, data: dataMerged.filter(m => req.params.moduleName.includes(m.name)) });
367+
res.json({ success: true, data: modData });
368368
return;
369369
}
370370

0 commit comments

Comments
 (0)