public function changeTemplateAction(Type $type, Request $request)
    {
        $form = $this->formFactory->create(
            HomeTemplateType::class,
            $type,
            ['dir' => $this->homeService->getTemplatesDirectory()]
        );
        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->manager->persistType($type);

            return new JsonResponse('success', 200);
        } else {
            return ['form' => $form->createView(), 'type' => $type];
        }
    }