$event =
new CustomerSetDefaultBillingAddressEvent($context,
$customer,
$addressId);
$this->eventDispatcher->
dispatch($event);
break;
default:
$data =
[ 'id' =>
$customer->
getId(),
'defaultShippingAddressId' =>
$addressId,
];
$event =
new CustomerSetDefaultShippingAddressEvent($context,
$customer,
$addressId);
$this->eventDispatcher->
dispatch($event);
break;
} $this->customerRepository->
update([$data],
$context->
getContext());
return new NoContentResponse();
}}