public function intCreateSiPrefixes(Request $request)
{
if (!$this->ensureAuthKey($request)) {
return $this->getAuthKeyErrorResponse();
}
$response = ['success' => true, 'errors' => [], 'message' => 'SI Prefixes successfully created/updated'];
try {
$this->get('partkeepr.setup.si_prefix_service')->importSiPrefixes();
} catch (\Exception $e) {
$response['success'] = false;
$response['message'] = 'SI Prefix creation error';
$response['errors'] = [$e->getMessage()];
}
return new JsonResponse($response);
}