'passwordFormViolation' =>
$request->
get('passwordFormViolation'
),
'emailFormViolation' =>
$request->
get('emailFormViolation'
),
]);
} #[Route(path: '/account/profile', name: 'frontend.account.profile.save', defaults: ['_loginRequired' => true], methods: ['POST'])]
public function saveProfile(RequestDataBag
$data, SalesChannelContext
$context, CustomerEntity
$customer): Response
{ try { $this->changeCustomerProfileRoute->
change($data,
$context,
$customer);
$this->
addFlash(self::SUCCESS,
$this->
trans('account.profileUpdateSuccess'
));
} catch (ConstraintViolationException
$formViolations) { return $this->
forwardToRoute('frontend.account.profile.page',
['formViolations' =>
$formViolations]);
} catch (\Exception
$exception) { $this->logger->
error($exception->
getMessage(),
['e' =>
$exception]);
$this->
addFlash(self::DANGER,
$this->
trans('error.message-default'
));
} return $this->
redirectToRoute('frontend.account.profile.page'
);
} #[Route(path: '/account/profile/email', name: 'frontend.account.profile.email.save', defaults: ['_loginRequired' => true], methods: ['POST'])]