PartKeepr\SetupBundle\Controller\FootprintSetupController::intCreateFootprints PHP Method

intCreateFootprints() public method

public intCreateFootprints ( Request $request )
$request Symfony\Component\HttpFoundation\Request
    public function intCreateFootprints(Request $request)
    {
        if (!$this->ensureAuthKey($request)) {
            return $this->getAuthKeyErrorResponse();
        }
        $response = ['success' => true, 'errors' => [], 'message' => 'Default footprints successfully created'];
        try {
            $this->get('partkeepr.setup.footprint_service')->importFootprints();
        } catch (\Exception $e) {
            $response['success'] = false;
            $response['message'] = 'Footprint creation error';
            $response['errors'] = [$e->getMessage()];
        }
        return new JsonResponse($response);
    }