feat: return to detail view after editing accommodation booking
This commit is contained in:
@@ -135,7 +135,17 @@ class EditController extends AbstractController
|
||||
'groupName' => $booking->getGroupName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_accommodationbooking_edit', ['id' => $booking->getId()]);
|
||||
// Back to the detail page rather than the form: that is where every named status
|
||||
// action lives, so it is the view a manager needs after saving. The return url is
|
||||
// forwarded still encoded, the way return_url() handed it over, so that the detail
|
||||
// page's "zurück" leads to the filtered list the edit was started from.
|
||||
$parameters = ['id' => $booking->getId()];
|
||||
$returnUrl = $request->query->getString('r');
|
||||
if ('' !== $returnUrl) {
|
||||
$parameters['r'] = $returnUrl;
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_admin_accommodationbooking_show', $parameters);
|
||||
}
|
||||
|
||||
return $this->render('admin/accommodation_booking/edit.html.twig', [
|
||||
|
||||
Reference in New Issue
Block a user