Fix error when deleting pins
This commit is contained in:
parent
db05ae4934
commit
b11ca43a08
|
@ -126,7 +126,7 @@ sub del_pin($c) {
|
|||
})->then(sub ($pin) {
|
||||
if (!defined $pin) {
|
||||
$c->flash(msg => "That pin doesn't exist.");
|
||||
return $c->redirect_to('/my/tokens');
|
||||
return $c->redirect_to('/my');
|
||||
}
|
||||
|
||||
# I wonder if this could cause a race condition.
|
||||
|
@ -160,6 +160,9 @@ sub del_pin($c) {
|
|||
})->then(sub {
|
||||
$c->flash(msg => "Pin deleted.");
|
||||
return $c->redirect_to('/my');
|
||||
}, sub {
|
||||
$c->flash(msg => "Error: " . $_);
|
||||
return $c->redirect_to('/my');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ sub update($self, $update, $where) {
|
|||
}
|
||||
|
||||
sub cid_count($self, $cid) {
|
||||
return count({cid => $cid});
|
||||
return $self->count({cid => $cid});
|
||||
}
|
||||
|
||||
sub count($self, $where) {
|
||||
|
|
Loading…
Reference in New Issue