mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Add strapi dependency to strapi-mongoose
This commit is contained in:
parent
02cc042838
commit
04d7e95234
@ -156,11 +156,11 @@ module.exports = function (strapi) {
|
||||
|
||||
switch (verbose) {
|
||||
case 'hasOne':
|
||||
const FK = _.findKey(strapi.models[details.model].attributes, function (details) {
|
||||
if (details.hasOwnProperty('model') && details.model === model && details.hasOwnProperty('via') && details.via === name) {
|
||||
return details;
|
||||
}
|
||||
});
|
||||
// const FK = _.findKey(strapi.models[details.model].attributes, function (details) {
|
||||
// if (details.hasOwnProperty('model') && details.model === model && details.hasOwnProperty('via') && details.via === name) {
|
||||
// return details;
|
||||
// }
|
||||
// });
|
||||
|
||||
loadedModel[name] = {
|
||||
type: Schema.Types.ObjectId,
|
||||
@ -169,11 +169,11 @@ module.exports = function (strapi) {
|
||||
break;
|
||||
|
||||
case 'hasMany':
|
||||
const FK = _.findKey(strapi.models[details.collection].attributes, function (details) {
|
||||
if (details.hasOwnProperty('collection') && details.collection === model && details.hasOwnProperty('via') && details.via === name) {
|
||||
return details;
|
||||
}
|
||||
});
|
||||
// const FK = _.findKey(strapi.models[details.collection].attributes, function (details) {
|
||||
// if (details.hasOwnProperty('collection') && details.collection === model && details.hasOwnProperty('via') && details.via === name) {
|
||||
// return details;
|
||||
// }
|
||||
// });
|
||||
|
||||
loadedModel[name] = [{
|
||||
type: Schema.Types.ObjectId,
|
||||
@ -182,11 +182,11 @@ module.exports = function (strapi) {
|
||||
break;
|
||||
|
||||
case 'belongsTo':
|
||||
const FK = _.findKey(strapi.models[details.model].attributes, function (details) {
|
||||
if (details.hasOwnProperty('model') && details.model === model) {
|
||||
return details;
|
||||
}
|
||||
});
|
||||
// const FK = _.findKey(strapi.models[details.model].attributes, function (details) {
|
||||
// if (details.hasOwnProperty('model') && details.model === model) {
|
||||
// return details;
|
||||
// }
|
||||
// });
|
||||
|
||||
loadedModel[name] = {
|
||||
type: Schema.Types.ObjectId,
|
||||
@ -195,11 +195,11 @@ module.exports = function (strapi) {
|
||||
break;
|
||||
|
||||
case 'belongsToMany':
|
||||
const FK = _.findKey(strapi.models[details.collection].attributes, function (details) {
|
||||
if (details.hasOwnProperty('model') && details.collection === model) {
|
||||
return details;
|
||||
}
|
||||
});
|
||||
// const FK = _.findKey(strapi.models[details.collection].attributes, function (details) {
|
||||
// if (details.hasOwnProperty('model') && details.collection === model) {
|
||||
// return details;
|
||||
// }
|
||||
// });
|
||||
|
||||
loadedModel[name] = [{
|
||||
type: Schema.Types.ObjectId,
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
"dependencies": {
|
||||
"mongoose": "~4.5.4",
|
||||
"lodash": "~4.6.1",
|
||||
"pluralize": "~1.2.1"
|
||||
"pluralize": "~1.2.1",
|
||||
"strapi": "~2.0.0"
|
||||
},
|
||||
"strapi": {
|
||||
"isHook": true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user