Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix class name #106

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/application/infrastructure/dto/githubApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ export type PullRequestReviewCommentConnection = {
totalCount: number
}

export type PillRequestReview = {
export type PullRequestReview = {
body: string
comments: PullRequestReviewCommentConnection
}

export type PillRequestReviewConnection = {
export type PullRequestReviewConnection = {
totalCount: number
nodes: PillRequestReview[]
nodes: PullRequestReview[]
}

export type UserRequestedReviewer = User
Expand Down Expand Up @@ -101,7 +101,7 @@ export type PullRequest = {
deletions: number
changedFiles: number
isDraft: boolean
reviews: PillRequestReviewConnection
reviews: PullRequestReviewConnection
reviewRequests: ReviewRequestConnection
viewerDidAuthor: boolean
state: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { GitHubAccessor, Option } from '@/application/domain/interface/githubAcc
import {
Commit,
CommitHistory,
Issues,
Issue,
Issues,
Label,
PullRequest,
PullRequests,
PullRequestReviews,
TagReference,
PullRequests,
Release,
Releases,
TagReference,
} from '@/application/domain/model/github'
import { RepositorySetting } from '@/application/domain/model/githubRepository'
import {
CommitHistoryConnection,
IssueConnection,
PullRequestConnection,
PillRequestReview,
PillRequestReviewConnection,
PullRequestReview,
PullRequestReviewConnection,
ReleaseConnection,
} from '@/application/infrastructure/dto/githubApi'
import {
Expand Down Expand Up @@ -89,12 +89,12 @@ export class GetPullRequestsUseCaseInteractor implements GetPullRequestsUseCase
throw new Error('Invalid GitHub URL.')
}

const reviewCommentMapper = (reviewNodes: PillRequestReview): number =>
const reviewCommentMapper = (reviewNodes: PullRequestReview): number =>
reviewNodes.body !== ''
? reviewNodes.comments.totalCount + 1
: reviewNodes.comments.totalCount

const countReviewComments = (review: PillRequestReviewConnection): PullRequestReviews => {
const countReviewComments = (review: PullRequestReviewConnection): PullRequestReviews => {
const remained = review.totalCount !== review.nodes.length
const result = review.nodes.map(reviewCommentMapper).reduce((a, b) => a + b, 0)
return new PullRequestReviews(result, remained)
Expand Down