summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Traveling.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-25 09:22:54 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-25 09:22:54 +0200
commit2cae5a51d2f2a8002864860f452fa9474dc2ecb3 (patch)
treecc73a38b67b4567f12c385d3fe9626209b6c737b /lib/Travelynx/Controller/Traveling.pm
parent1e2e33399ff742f9b099fc219c41d2033ee233f7 (diff)
undo: Redirect to departure station when undoing a checkin
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 8c15782..5282d9a 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -140,6 +140,7 @@ sub log_action {
}
}
elsif ( $params->{action} eq 'undo' ) {
+ my $status = $self->get_user_status;
my $error = $self->undo( $params->{undo_id} );
if ($error) {
$self->render(
@@ -150,10 +151,14 @@ sub log_action {
);
}
else {
+ my $redir = '/';
+ if ($status->{checked_in} or $status->{cancelled}) {
+ $redir = '/s/' . $status->{dep_ds100};
+ }
$self->render(
json => {
success => 1,
- redirect_to => '/',
+ redirect_to => $redir,
},
);
}