$vacancy = $this->vacancyService->createEntity();
$form = $this->createForm(VacancyType::class, $vacancy);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->vacancyService->create($vacancy, $this->getUser());
$this->addFlash('success', 'Vacancy created');
return $this->redirectToRoute('vacancies');
}