{ } public function getDecorated(): AbstractChangeEmailRoute
{ throw new DecorationPatternException(self::
class);
} #[Route(path: '/store-api/account/change-email', name: 'store-api.account.change-email', methods: ['POST'], defaults: ['_loginRequired' => true])]
public function change(RequestDataBag
$requestDataBag, SalesChannelContext
$context, CustomerEntity
$customer): SuccessResponse
{ $this->
validateEmail($requestDataBag,
$context);
$customerData =
[ 'id' =>
$customer->
getId(),
'email' =>
$requestDataBag->
get('email'
),
];
$this->customerRepository->
update([$customerData],
$context->
getContext());
return new SuccessResponse();
}