Skip to content

Commit

Permalink
fix(api-github-v4): workaround for deleted user
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Oct 11, 2019
1 parent f363c7b commit 2b3d5d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/@vssue/api-github-v4/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { VssueAPI } from 'vssue'

export function normalizeUser (user: any): VssueAPI.User {
// workaround for deleted user
// @see https://github.community/t5/GitHub-API-Development-and/Keep-deleted-issue-author-as-ghost/td-p/15456
if (user === null) {
return {
username: 'ghost',
avatar: 'https://avatars3.githubusercontent.com/u/10137?v=4',
homepage: 'https://github.com/ghost',
}
}
return {
username: user.login,
avatar: user.avatarUrl,
Expand Down

0 comments on commit 2b3d5d2

Please sign in to comment.