Skip to content

Commit

Permalink
fix: LinkCard callback url
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Jul 11, 2023
1 parent 3433503 commit 29179f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/ui/link-card/LinkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ const LinkCardImpl: FC<LinkCardProps> = (props) => {
const data = await axios
.get<any>(`https://api.github.com/repos/${namespace}/${repo}`)
.then((data) => camelcaseKeys(data.data))
.catch(() => {
// set fallback url
//
setFullUrl(`https://github.com/${namespace}/${repo}`)
})

setCardInfo({
image: data.owner.avatarUrl,
Expand Down Expand Up @@ -156,6 +161,13 @@ const LinkCardImpl: FC<LinkCardProps> = (props) => {
`https://api.github.com/repos/${namespace}/${repo}/commits/${commitId}`,
)
.then((data) => camelcaseKeys(data.data))
.catch(() => {
// set fallback url
//
setFullUrl(
`https://github.com/${namespace}/${repo}/commit/${commitId}`,
)
})

setCardInfo({
image: data.author.avatarUrl,
Expand Down

1 comment on commit 29179f4

@vercel
Copy link

@vercel vercel bot commented on 29179f4 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
springtide.vercel.app
innei.in
shiro-innei.vercel.app

Please sign in to comment.