mirror of
https://github.com/strapi/strapi.git
synced 2026-01-06 12:13:52 +00:00
Update mount-models.js (#6916)
This is to ensure custom mongoose queries that exclude dynamic zone fields don't fail. Referring to this issue: https://github.com/strapi/strapi/issues/6016
This commit is contained in:
parent
fd3c7699b5
commit
66637e0101
@ -212,14 +212,16 @@ module.exports = ({ models, target }, ctx) => {
|
||||
}
|
||||
|
||||
if (type === 'dynamiczone') {
|
||||
const components = returned[name].map(el => {
|
||||
return {
|
||||
__component: findComponentByGlobalId(el.kind).uid,
|
||||
...el.ref,
|
||||
};
|
||||
});
|
||||
if(returned[name]){
|
||||
const components = returned[name].map(el => {
|
||||
return {
|
||||
__component: findComponentByGlobalId(el.kind).uid,
|
||||
...el.ref,
|
||||
};
|
||||
});
|
||||
|
||||
returned[name] = components;
|
||||
returned[name] = components;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user