Skip to content

Commit 138b1c3

Browse files
committed
chore: apply coderabbitai suggestion for useInfo
1 parent f70e50f commit 138b1c3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

server/api/contributors.get.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ type GitHubAPIContributor = Omit<GitHubContributor, 'role' | 'sponsors_url' | ke
3030
// Only stewards are shown as maintainers; everyone else is a contributor.
3131
const FALLBACK_STEWARDS = new Set(['danielroe', 'patak-dev'])
3232

33+
const DEFAULT_USER_INFO: GitHubUserData = {
34+
name: null,
35+
bio: null,
36+
company: null,
37+
companyHTML: null,
38+
location: null,
39+
websiteUrl: null,
40+
twitterUsername: null,
41+
}
42+
3343
interface TeamMembers {
3444
steward: Set<string>
3545
maintainer: Set<string>
@@ -246,7 +256,7 @@ export default defineCachedEventHandler(
246256
return filtered
247257
.map(c => {
248258
const { role, order } = getRoleInfo(c.login, teams)
249-
const userInfo = userData.get(c.login) || {}
259+
const userInfo = userData.get(c.login) ?? DEFAULT_USER_INFO
250260
const sponsors_url = sponsorable.has(c.login)
251261
? `https://github.com/sponsors/${c.login}`
252262
: null

0 commit comments

Comments
 (0)