feat: added number of languages param for top langs card (#445)

* feat: num_langs param for top langs

* fix: top-langs card bottom padding with num_langs param

* fix: clamp toplangs num_langs rather than throwing error

* feat: changed param name & fixed minor issues, added tests

Co-authored-by: anuraghazra <hazru.anurag@gmail.com>
This commit is contained in:
Benjamin Ashbaughandanuraghazra authored and GitHub committed 2020-09-12 18:46:18 +05:30
1 parent 0f3bed5174
commit e9019c1453
6 files changed
+33 -7

No files matched your search

+2 -1
View File
@@ -23,6 +23,7 @@ module.exports = async (req, res) => {
theme,
cache_seconds,
layout,
langs_count,
} = req.query;
let topLangs;
@@ -33,7 +34,7 @@ module.exports = async (req, res) => {
}
try {
topLangs = await fetchTopLanguages(username);
topLangs = await fetchTopLanguages(username, langs_count);
const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),