undo: Redirect to departure station when undoing a checkin
This commit is contained in:
parent
1e2e33399f
commit
2cae5a51d2
1 changed files with 6 additions and 1 deletions
|
@ -140,6 +140,7 @@ sub log_action {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( $params->{action} eq 'undo' ) {
|
elsif ( $params->{action} eq 'undo' ) {
|
||||||
|
my $status = $self->get_user_status;
|
||||||
my $error = $self->undo( $params->{undo_id} );
|
my $error = $self->undo( $params->{undo_id} );
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->render(
|
$self->render(
|
||||||
|
@ -150,10 +151,14 @@ sub log_action {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
my $redir = '/';
|
||||||
|
if ($status->{checked_in} or $status->{cancelled}) {
|
||||||
|
$redir = '/s/' . $status->{dep_ds100};
|
||||||
|
}
|
||||||
$self->render(
|
$self->render(
|
||||||
json => {
|
json => {
|
||||||
success => 1,
|
success => 1,
|
||||||
redirect_to => '/',
|
redirect_to => $redir,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue