-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from InterwebAlchemy/feature/github-api
fix: attempt to get profile info from GitHub public API
- Loading branch information
Showing
12 changed files
with
86 additions
and
100 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import fetch from 'cross-fetch' | ||
|
||
import type { Endpoints } from '@octokit/types' | ||
|
||
import type { definitions } from '../../types/supabase' | ||
|
||
import { GITHUB_API_URL } from '../../constants' | ||
|
||
export const gitHubUserDetails = async ( | ||
username: definitions['profiles']['username'] | ||
): Promise<Endpoints['GET /users/{username}']['response']['data']> => { | ||
return fetch(new URL(`/users/${username}`, GITHUB_API_URL).toString(), { | ||
headers: { | ||
Accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
.then(async (response) => response.json()) | ||
.catch((e) => { | ||
console.error(e) | ||
}) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { definitions } from './supabase' | ||
|
||
export interface FullUserProfile | ||
extends Pick<definitions['profiles'], 'id' | 'username' | 'website' | 'communication_style'> { | ||
extends Pick<definitions['profiles'], 'id' | 'avatar_url' | 'username' | 'website' | 'communication_style'> { | ||
personality: Pick<definitions['personality_types'], 'type' | 'name' | 'description' | 'url'> | ||
color: Pick<definitions['personality_colors'], 'name' | 'description' | 'url'> | ||
enneagram: Pick<definitions['enneagram_types'], 'name' | 'number' | 'description' | 'url'> | ||
avatarUrl?: string | ||
} |
c9f7882
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for work-with-me ready!
✅ Preview
https://work-with-me-38zs2kcje-interweb-alchemy.vercel.app
https://work-with-me.vercel.app
Built with commit c9f7882.
This pull request is being automatically deployed with vercel-action