Commit 2cae5a51 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

undo: Redirect to departure station when undoing a checkin

parent 1e2e3339
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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,
				},
			);
		}