[ 'name_template' => $data->getName(), 'content_template' => $data->getTemplateContent(), ] ]; $content = $this->createRequest('POST', '/ogboot/v1/pxe-templates' , $params); if (isset($content['error']) && $content['error'] === Response::HTTP_INTERNAL_SERVER_ERROR ) { throw new BadRequestHttpException('An error occurred: ' . $content['error']); } $data->setSynchronized(true); $this->entityManager->persist($data); $this->entityManager->flush(); return new JsonResponse(data: $content, status: Response::HTTP_OK); } }