Skip to content

Commit e45249c

Browse files
author
stackcats
committed
fix: years.length
1 parent bc7ac25 commit e45249c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = async (req, res) => {
2424
const years = _.range(2015, currentYear + 1);
2525
const stars = await Promise.all(_.map(years, year => fetch(year)));
2626
const doc = {};
27-
for (let i = 0; i < year; i++) {
27+
for (let i = 0; i < years.length; i++) {
2828
doc[years[i]] = `${stars[i]}*`;
2929
}
3030
const allStars = stars.reduce((acc, star) => acc + star);

0 commit comments

Comments
 (0)