mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Prevent fall through in the model search method when a plugin is specified (#6004)
Signed-off-by: Aleksandr Yackovlev <a.yackovlev@corp.mail.ru>
This commit is contained in:
parent
a96d41eeca
commit
c9925f3fa8
@ -108,11 +108,11 @@ class DatabaseManager {
|
||||
return _.get(strapi.admin, ['models', key]);
|
||||
}
|
||||
|
||||
return (
|
||||
_.get(strapi.plugins, [plugin, 'models', key]) ||
|
||||
_.get(strapi, ['models', key]) ||
|
||||
_.get(strapi, ['components', key])
|
||||
);
|
||||
if (plugin) {
|
||||
return _.get(strapi.plugins, [plugin, 'models', key]);
|
||||
}
|
||||
|
||||
return _.get(strapi, ['models', key]) || _.get(strapi, ['components', key]);
|
||||
}
|
||||
|
||||
getModelByCollectionName(collectionName) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user