add flash only if correct user and redirect then
This commit is contained in:
parent
54d57b2b83
commit
3a44d42168
1 changed files with 9 additions and 7 deletions
|
@ -130,12 +130,14 @@ class OfferController extends AbstractController
|
||||||
{
|
{
|
||||||
$this->entityManager->remove($offer);
|
$this->entityManager->remove($offer);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
$this->addFlash(
|
||||||
|
'success','Successfully removed offer!'
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->redirectToRoute('user_page');
|
||||||
|
}
|
||||||
|
|
||||||
$this->addFlash(
|
throw new HttpException(403, "No permission");
|
||||||
'success','Successfully removed offer!'
|
|
||||||
);
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('user_page');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue