add flash only if correct user and redirect then

This commit is contained in:
Jannis Portmann 2021-05-16 15:33:53 +02:00
parent 54d57b2b83
commit 3a44d42168

View file

@ -130,12 +130,14 @@ class OfferController extends AbstractController
{
$this->entityManager->remove($offer);
$this->entityManager->flush();
}
$this->addFlash(
'success','Successfully removed offer!'
);
return $this->redirectToRoute('user_page');
}
$this->addFlash(
'success','Successfully removed offer!'
);
return $this->redirectToRoute('user_page');
}
throw new HttpException(403, "No permission");
}
}