fix: fix followers amount for user with thousands of followers

This commit is contained in:
2024-08-10 00:55:58 +07:00
parent c983044e11
commit 9ed2984dbd
2 changed files with 19 additions and 5 deletions
+7 -1
View File
@@ -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)