From 158f6f223a5dad7c24a6856f9487aaaa6ee56765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Uma=C3=B1a?= <56659913+oscaru21@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:40:14 -0600 Subject: [PATCH] add repos sort query parameters to request --- src/context/github/GithubActions.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/context/github/GithubActions.js b/src/context/github/GithubActions.js index 50ca5f2..59a98e0 100644 --- a/src/context/github/GithubActions.js +++ b/src/context/github/GithubActions.js @@ -19,9 +19,14 @@ export const searchUsers = async (text) => { // Get user and repos export const getUserAndRepos = async (login) => { + const params = new URLSearchParams({ + sort: 'created', + per_page: 10 + }) + const [user, repos] = await Promise.all([ github.get(`/users/${login}`), - github.get(`/users/${login}/repos`), + github.get(`/users/${login}/repos?${params}`), ]) return { user: user.data, repos: repos.data }