mirror of
https://github.com/strapi/strapi.git
synced 2025-11-30 00:51:06 +00:00
fix: find published relations on components
This commit is contained in:
parent
d6c661f8ab
commit
6a5663977e
@ -127,10 +127,12 @@ const validateStatus = (
|
||||
const sourceModel = strapi.getModel(sourceUid);
|
||||
|
||||
const isDP = contentTypes.hasDraftAndPublish;
|
||||
const isSourceDP = isDP(sourceModel);
|
||||
const isSourceDP = isDP(sourceModel)
|
||||
|
||||
// Default to draft if not set
|
||||
if (!isSourceDP) return { status: undefined };
|
||||
if (!isSourceDP && sourceModel.modelType === 'contentType') {
|
||||
return { status: undefined };
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case 'published':
|
||||
@ -450,7 +452,7 @@ export default {
|
||||
publishedAt?: Record<string, any>;
|
||||
} = {};
|
||||
|
||||
if (sourceSchema?.options?.draftAndPublish) {
|
||||
if (sourceSchema?.options?.draftAndPublish || sourceSchema?.modelType === 'component') {
|
||||
if (targetSchema?.options?.draftAndPublish) {
|
||||
if (status === 'published') {
|
||||
filters.publishedAt = { $notNull: true };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user