We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b230542 commit e1e643dCopy full SHA for e1e643d
lib/MetaCPAN/Web/Controller/Account/Favorite.pm
@@ -22,8 +22,14 @@ sub add : Local : Args(0) {
22
}
23
24
if ($json) {
25
- $c->res->code(400) if $res->{error};
26
- $c->stash->{json}{success} = $res->{error} ? \0 : \1;
+ if ($res->{error}) {
+ $c->res->code(400);
27
+ $c->stash->{json}{success} = \0;
28
+ $c->stash->{json}{error} = $res->{error};
29
+ }
30
+ else {
31
+ $c->stash->{json}{success} = \1;
32
33
34
else {
35
$c->res->redirect(
0 commit comments