Filter out empty email post-content
MAILPOET-5949
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
f79c0cec55
commit
4f948dfd65
@ -140,16 +140,15 @@ export const getEditedEmailContent = createRegistrySelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const getSentEmailEditorPosts = createRegistrySelector(
|
export const getSentEmailEditorPosts = createRegistrySelector(
|
||||||
( select ) => () => {
|
( select ) => () =>
|
||||||
const posts: EmailEditorPostType[] = select(
|
select( coreDataStore )
|
||||||
coreDataStore
|
.getEntityRecords( 'postType', 'mailpoet_email', {
|
||||||
).getEntityRecords( 'postType', 'mailpoet_email', {
|
per_page: 30, // show a maximum of 30 for now
|
||||||
per_page: 30, // show a maximum of 30 for now
|
status: 'publish,sent', // show only sent emails
|
||||||
status: 'publish,sent', // show only sent emails
|
} )
|
||||||
} );
|
?.filter(
|
||||||
|
( post: EmailEditorPostType ) => post?.content?.raw !== '' // filter out empty content
|
||||||
return posts;
|
)
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user