/**
* @throws Exception
*/
#[Route(path: '/api/_action/customer-group-registration/accept', name: 'api.customer-group.accept', methods: ['POST'], requirements: ['version' => '\d+'])]
public function accept(Request
$request, Context
$context): JsonResponse
{ $customerIds =
$this->
getRequestCustomerIds($request);
$silentError =
$request->request->
getBoolean('silentError'
);
$customers =
$this->
fetchCustomers($customerIds,
$context,
$silentError);
$updateData =
[];
foreach ($customers as $customer) { $updateData[] =
[ 'id' =>
$customer->
getId(),
'requestedGroupId' => null,
'groupId' =>
$customer->
getRequestedGroupId(),
];
}