Skip to content

Commit 86b08d1

Browse files
authored
Merge pull request #977 from metacpan/haarg/fix-recent-favorites-total
fix total in recent favorites output
2 parents 77cc81d + 0dbdc23 commit 86b08d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/MetaCPAN/Query/Favorite.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,13 @@ sub recent {
158158
sort => [ { 'date' => { order => 'desc' } } ]
159159
}
160160
);
161-
return {} unless $favs->{hits}{total};
162161

163162
my @favs = map { $_->{_source} } @{ $favs->{hits}{hits} };
164163

165164
return +{
166165
favorites => \@favs,
167166
took => $favs->{took},
168-
total => $favs->{total}
167+
total => $favs->{hits}{total}
169168
};
170169
}
171170

0 commit comments

Comments
 (0)