From 6ae726695ec8254730d23341e876d40578f770fa Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Sat, 3 Aug 2024 18:33:24 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=99=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- legacy/src/services/github-client.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/legacy/src/services/github-client.ts b/legacy/src/services/github-client.ts index b9b7072b..125a1e04 100644 --- a/legacy/src/services/github-client.ts +++ b/legacy/src/services/github-client.ts @@ -62,7 +62,14 @@ export class GitHubClient extends AIFunctionsProvider { this.octokit = new Octokit({ auth: apiKey }) } - async getUser(username: string): Promise { + async getUserByUsername( + usernameOrOpts: string | { username: string } + ): Promise { + 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'