Skip to content

Commit

Permalink
🙌
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Aug 3, 2024
1 parent 82bf84e commit 2037883
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/services/github-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ export class GitHubClient extends AIFunctionsProvider {
this.octokit = new Octokit({ auth: apiKey })
}

async getUser(username: string): Promise<github.User> {
async getUserByUsername(
usernameOrOpts: string | { username: string }
): Promise<github.User> {
const { username } =
typeof usernameOrOpts === 'string'
? { username: usernameOrOpts }
: usernameOrOpts

const res = await this.octokit.request(`GET /users/${username}`, {
headers: {
'X-GitHub-Api-Version': '2022-11-28'
Expand Down

0 comments on commit 2037883

Please sign in to comment.