mirror of
https://github.com/khairul169/github-leaderboard.git
synced 2026-09-17 09:53:21 +07:00
fix: fix followers amount for user with thousands of followers
This commit is contained in:
@@ -13,7 +13,13 @@ export const fetchUserProfile = async (data: FetchUserProfileType) => {
|
||||
if (!user) {
|
||||
throw new Error("User not found!");
|
||||
}
|
||||
const details = await github.getUser(user.username);
|
||||
|
||||
const accessToken = user.accessToken || import.meta.env.GITHUB_DEFAULT_TOKEN;
|
||||
const details = await github.getUser(user.username, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
|
||||
await db
|
||||
.update(users)
|
||||
|
||||
Reference in New Issue
Block a user