Skip to content

Commit

Permalink
fix: ensure membership cancellation persists
Browse files Browse the repository at this point in the history
Add missing flush of the entity manager after cancelling a membership. This ensures that changes to the member's subscription details are correctly saved to the database.
  • Loading branch information
LukaBerkers committed Nov 17, 2024
1 parent 0c32ac2 commit 5ec8f92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Controller/Admin/MemberCrud.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function cancelMembership(AdminContext $adminContext, MollieApiClient $mo
$subscription = $mollieApiClient->subscriptions->getFor($customer, $member->getMollieSubscriptionId());
$subscription->cancel();
$member->setMollieSubscriptionId(null);
$em = $this->getDoctrine()->getManager();
$em->flush();
return new Response('Membership cancelled succesfully');
}
Expand Down

0 comments on commit 5ec8f92

Please sign in to comment.