mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
WIP on node-to-node msg
+ Preview * Fix node IDs + Add new MenuModule method for validating MCI codes
This commit is contained in:
parent
23af00e7ec
commit
b3930d1999
3 changed files with 56 additions and 13 deletions
|
@ -549,4 +549,20 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
validateMCIByViewIds(formName, viewIds, cb) {
|
||||
if(!Array.isArray(viewIds)) {
|
||||
viewIds = [ viewIds ];
|
||||
}
|
||||
const form = _.get(this, [ 'viewControllers', formName ] );
|
||||
if(!form) {
|
||||
return cb(Errors.DoesNotExist(`Form does not exist: ${formName}`));
|
||||
}
|
||||
for(let i = 0; i < viewIds.length; ++i) {
|
||||
if(!form.hasView(viewIds[i])) {
|
||||
return cb(Errors.MissingMci(`Missing MCI ${viewIds[i]}`));
|
||||
}
|
||||
}
|
||||
return cb(null);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue