|
4 | 4 |
|
5 | 5 | namespace PhpList\RestBundle\Subscription\Controller; |
6 | 6 |
|
| 7 | +use Doctrine\ORM\EntityManagerInterface; |
7 | 8 | use OpenApi\Attributes as OA; |
8 | 9 | use PhpList\Core\Domain\Identity\Model\PrivilegeFlag; |
9 | 10 | use PhpList\Core\Domain\Subscription\Model\Subscriber; |
@@ -34,6 +35,7 @@ public function __construct( |
34 | 35 | Authentication $authentication, |
35 | 36 | RequestValidator $validator, |
36 | 37 | SubscriberService $subscriberService, |
| 38 | + private readonly EntityManagerInterface $entityManager, |
37 | 39 | ) { |
38 | 40 | parent::__construct($authentication, $validator); |
39 | 41 | $this->authentication = $authentication; |
@@ -439,6 +441,7 @@ public function resetBounceCount( |
439 | 441 | } |
440 | 442 |
|
441 | 443 | $subscriberData = $this->subscriberService->resetSubscriberBounceCount($subscriber); |
| 444 | + $this->entityManager->flush(); |
442 | 445 |
|
443 | 446 | return $this->json($subscriberData, Response::HTTP_OK); |
444 | 447 | } |
@@ -485,6 +488,7 @@ public function setSubscriberAsConfirmed(Request $request): Response |
485 | 488 | } |
486 | 489 |
|
487 | 490 | $subscriber = $this->subscriberService->confirmSubscriber($uniqueId); |
| 491 | + $this->entityManager->flush(); |
488 | 492 |
|
489 | 493 | if (!$subscriber) { |
490 | 494 | return new Response('<h1>Subscriber isn\'t found or already confirmed.</h1>', 404); |
|
0 commit comments