Skip to content
Snippets Groups Projects
Commit 96fbe0af authored by clemo's avatar clemo
Browse files

Merge branch 'dev' into 'stable-v1'

Dev

See merge request !13
parents ae14900c f9f01a30
Branches stable-v1
No related tags found
1 merge request!13Dev
Pipeline #
{
"baseBranches": ["dev","dev-*"]
}
[reports can be found on ipfs](https://gateway.ipfs.io/ipfs/QmPnmhaoeYsUDJm1yx7GGQxuoECWA8Vy9T9CqPPcP8HkRY) `/ipfs/QmPnmhaoeYsUDJm1yx7GGQxuoECWA8Vy9T9CqPPcP8HkRY`
[reports can be found on ipfs](https://gateway.ipfs.io/ipfs/QmQW4pBuDgiT7FkmQchmhVKQ6AM8rCLVhehjeFyNTS4vWE) `/ipfs/QmQW4pBuDgiT7FkmQchmhVKQ6AM8rCLVhehjeFyNTS4vWE`
......@@ -32,20 +32,8 @@ export const moduleLoader = function(app, config, ...args) {
dbug('require module',m);
routes[m] = require(process.env.PWD + '/modules/' + m + '/route.js').default;
}catch(e){
if(e.code === 'MODULE_NOT_FOUND'){
try{
dbug('require module from npm',m,e);
routes[m] = require(m).default;
}catch(npm_error){
error('module local & npm error:',m,e);
}
}else{
error('module local but error',m,e);
}
dbug('require module from npm',m);
routes[m] = require(m).default;
}
}
app.use((req, res, next) => {
......
......@@ -108,10 +108,18 @@ export class Lib {
}
/** mark a item as removed -> will not be in getArray but getArrayById
* @param {String} id - id of item to remove
* @return {boolean} deleted - deleted or not found in undeleted objs
*/
remove(id) {
log('remove item', id);
this.getById(id)._remove = true;
const item = this.getById(id);
if('undefined' !== typeof item){
this.getById(id)._remove = true;
return true;
}else{
return false;
}
}
/** cb fired on every item from `this.getArray`
*@param {function} cb - `(item)=>{console.log(item)};`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment