Skip to content

Commit

Permalink
Merge pull request #258 from wildan3105/fix/handle-current-year-in-er…
Browse files Browse the repository at this point in the history
…ror-page

fix: pass current year to too many repos page handler
  • Loading branch information
wildan3105 authored Oct 30, 2024
2 parents 7615d88 + 1b9fb1f commit 7d8e891
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const reqRepos = async (username, numberOfPages) => {
};

exports.index = async (req, res) => {
const currentYear = new Date().getFullYear();
let avatar, msg, repos, statement, type, title, languages = {};
const { username } = req.query;
const defaultRenderValue = {
Expand All @@ -51,7 +52,7 @@ exports.index = async (req, res) => {
type,
title,
languages,
currentYear: new Date().getFullYear(),
currentYear,
username: ''
};

Expand All @@ -74,7 +75,8 @@ exports.index = async (req, res) => {
error: {
code: 'Too many repos',
message: warningMessage
}
},
currentYear
});
return;
}
Expand Down

0 comments on commit 7d8e891

Please sign in to comment.