mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 19:36:20 +00:00
Load bookshelf plugin model if not apis
This commit is contained in:
parent
0655833da9
commit
95607dc7ed
@ -45,11 +45,6 @@ module.exports = function(strapi) {
|
||||
// Initialize collections
|
||||
_.set(strapi, 'bookshelf.collections', {});
|
||||
|
||||
// Return callback if there is no model
|
||||
if (_.isEmpty(strapi.models)) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
const connections = _.pickBy(strapi.config.connections, {
|
||||
connector: 'strapi-bookshelf'
|
||||
});
|
||||
@ -91,14 +86,6 @@ module.exports = function(strapi) {
|
||||
_.assign(models, _.pickBy(strapi.models, (model) => model.connection === undefined));
|
||||
}
|
||||
|
||||
// Return callback if there is no model
|
||||
if (_.isEmpty(models)) {
|
||||
cb();
|
||||
|
||||
// Break the loop.
|
||||
return false;
|
||||
}
|
||||
|
||||
const loadedHook = _.after(_.size(models), () => {
|
||||
done();
|
||||
});
|
||||
|
||||
@ -252,34 +252,7 @@
|
||||
}
|
||||
},
|
||||
"application": {
|
||||
"controllers": {
|
||||
"article": {
|
||||
"find": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
},
|
||||
"findOne": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
},
|
||||
"create": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
},
|
||||
"update": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
},
|
||||
"destroy": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
},
|
||||
"identity": {
|
||||
"enabled": true,
|
||||
"policy": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
"controllers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -536,34 +509,7 @@
|
||||
}
|
||||
},
|
||||
"application": {
|
||||
"controllers": {
|
||||
"article": {
|
||||
"find": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
},
|
||||
"findOne": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
},
|
||||
"create": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
},
|
||||
"update": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
},
|
||||
"destroy": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
},
|
||||
"identity": {
|
||||
"enabled": false,
|
||||
"policy": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
"controllers": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user