Add minimalistic WpPostEntity for fetching basic post data for listing

[MAILPOET-5646]
This commit is contained in:
Rostislav Wolny
2023-11-06 16:51:06 +01:00
committed by Aschepikov
parent c9c7146ef1
commit 8be034822e
10 changed files with 107 additions and 41 deletions

View File

@@ -28,7 +28,7 @@ class EmailApiController {
* @return array - MailPoet specific email data that will be attached to the post API response
*/
public function getEmailData($postEmailData): array {
$newsletter = $this->newsletterRepository->findOneBy(['wpPostId' => $postEmailData['id']]);
$newsletter = $this->newsletterRepository->findOneBy(['wpPost' => $postEmailData['id']]);
return [
'id' => $newsletter ? $newsletter->getId() : null,
'subject' => $newsletter ? $newsletter->getSubject() : '',