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
No related branches found
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) { ...@@ -32,20 +32,8 @@ export const moduleLoader = function(app, config, ...args) {
dbug('require module',m); dbug('require module',m);
routes[m] = require(process.env.PWD + '/modules/' + m + '/route.js').default; routes[m] = require(process.env.PWD + '/modules/' + m + '/route.js').default;
}catch(e){ }catch(e){
if(e.code === 'MODULE_NOT_FOUND'){ dbug('require module from npm',m);
try{ routes[m] = require(m).default;
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);
}
} }
} }
app.use((req, res, next) => { app.use((req, res, next) => {
......
...@@ -108,10 +108,18 @@ export class Lib { ...@@ -108,10 +108,18 @@ export class Lib {
} }
/** mark a item as removed -> will not be in getArray but getArrayById /** mark a item as removed -> will not be in getArray but getArrayById
* @param {String} id - id of item to remove * @param {String} id - id of item to remove
* @return {boolean} deleted - deleted or not found in undeleted objs
*/ */
remove(id) { remove(id) {
log('remove item', 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` /** cb fired on every item from `this.getArray`
*@param {function} cb - `(item)=>{console.log(item)};` *@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