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, ); }