Skip to content

Commit 050b0fa

Browse files
removing get github users external data
1 parent e514b4d commit 050b0fa

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

src/helpers/generateMemberEndpoint.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function generateMemberEndpoint(githubMemberData) {
1111
avatar_url_small: "https://avatars.githubusercontent.com/u/" + githubMemberData.id + "?s=64&v=4",
1212
avatar_url_medium: "https://avatars.githubusercontent.com/u/" + githubMemberData.id + "?s=128&v=4",
1313
github_url: "https://github.com/" + githubMemberData.login,
14-
categories: []
14+
categories: [],
1515
};
1616
let data = await getRemoteFileData(
1717
`https://raw.githubusercontent.com/${githubMemberData.login}/${githubMemberData.login}/main/cucoders_data/profile-data.json`,
@@ -33,34 +33,7 @@ async function generateMemberEndpoint(githubMemberData) {
3333
profileData.categories = data.categories;
3434
profileData.telegram_username = data.telegram_username;
3535
profileData.linkedin_username = data.linkedin_username;
36-
} else {
37-
profileData = await getGitHubUserData(profileData);
3836
}
39-
40-
return profileData;
41-
}
42-
43-
async function getGitHubUserData(profileData) {
44-
const url = backend_url + "api/members/get-member?username=" + profileData.username;
45-
46-
const respose = await fetch(url, { method: "GET" });
47-
const data = await respose.json();
48-
49-
if (!data) {
50-
return profileData;
51-
}
52-
53-
if (data.name) {
54-
profileData.name = data.name;
55-
}
56-
profileData.company = data.company;
57-
profileData.web = data.blog;
58-
profileData.location = data.location;
59-
profileData.email = data.email;
60-
profileData.hireable = data.hireable;
61-
profileData.bio = data.bio;
62-
profileData.twitter_username = data.twitter_username;
63-
6437
return profileData;
6538
}
6639

0 commit comments

Comments
 (0)