Created
June 19, 2024 16:28
-
-
Save suhas86/46182e69422cf5f9e8235f92fc84aed0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import api from '../api'; | |
export const fetchTopUsersBySize = async (size: number = 30) => { | |
const response = await api.get( | |
`/search/users?q=followers:>1000&sort=followers&order=desc&per_page=${size}` | |
); | |
return response.data; | |
}; | |
export const fetchUserBySearch = async (text: string) => { | |
const response = await api.get(`/search/users?q=${text}`); | |
return response.data; | |
}; | |
export const fetchReposByUserName = async (userName: string) => { | |
const response = await api.get( | |
`/users/${userName}/repos?sort=created&direction=desc` | |
); | |
return response.data; | |
}; | |
export const fetchRepoBySearch = async (userName: string, text: string) => { | |
const response = await api.get( | |
`/search/repositories?q=user:${userName}+${text}` | |
); | |
return response.data; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment