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(
|
||||
( select ) => () => {
|
||||
const posts: EmailEditorPostType[] = select(
|
||||
coreDataStore
|
||||
).getEntityRecords( 'postType', 'mailpoet_email', {
|
||||
( select ) => () =>
|
||||
select( coreDataStore )
|
||||
.getEntityRecords( 'postType', 'mailpoet_email', {
|
||||
per_page: 30, // show a maximum of 30 for now
|
||||
status: 'publish,sent', // show only sent emails
|
||||
} );
|
||||
|
||||
return posts;
|
||||
}
|
||||
} )
|
||||
?.filter(
|
||||
( post: EmailEditorPostType ) => post?.content?.raw !== '' // filter out empty content
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user