From f88e07535bc5258ed302225ddf7f7c199ce25b89 Mon Sep 17 00:00:00 2001 From: ryo-ma Date: Tue, 25 Nov 2025 15:53:25 +0900 Subject: [PATCH] Fix promises process --- src/Services/GithubApiService.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Services/GithubApiService.ts b/src/Services/GithubApiService.ts index d226e3c..db43ad5 100644 --- a/src/Services/GithubApiService.ts +++ b/src/Services/GithubApiService.ts @@ -56,20 +56,16 @@ export class GithubApiService extends GithubRepository { } async requestUserInfo(username: string): Promise { // Avoid to call others if one of them is null - const repository = await this.requestUserRepository(username); - - if (repository instanceof ServiceError) { - Logger.error(repository); - return repository; - } const promises = Promise.allSettled([ + this.requestUserRepository(username), this.requestUserActivity(username), this.requestUserIssue(username), this.requestUserPullRequest(username), ]); - const [activity, issue, pullRequest] = await promises; + const [repository, activity, issue, pullRequest] = await promises; const status = [ + repository.status, activity.status, issue.status, pullRequest.status, @@ -84,7 +80,7 @@ export class GithubApiService extends GithubRepository { (activity as PromiseFulfilledResult).value, (issue as PromiseFulfilledResult).value, (pullRequest as PromiseFulfilledResult).value, - repository, + (repository as PromiseFulfilledResult).value, ); }