Skip to content

Commit

Permalink
feat : Change issueCount and open at update(#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbg0205 committed Jun 17, 2021
1 parent 14f889d commit a86cd68
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,20 @@ public void removeMilestone() {
}

public void updateIssue(IssueRequest issueRequest) {
boolean isIssueOpenRequest = issueRequest.isOpen();

if(this.open != isIssueOpenRequest && milestone != null) {
if (isIssueOpenRequest) {
this.milestone.openIssue();
}

if (!isIssueOpenRequest) {
this.milestone.closeIssue();
}
}

this.title = issueRequest.getTitle();
this.open = issueRequest.isOpen();
this.open = isIssueOpenRequest;
}

public static Issue create(User author, String title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,14 @@ public void countOpenIssuesDown() {
public void countClosedIssuesDown() {
this.closedIssues--;
}

public void openIssue() {
this.openIssues++;
this.closedIssues--;
}

public void closeIssue() {
this.openIssues--;
this.closedIssues++;
}
}

0 comments on commit a86cd68

Please sign in to comment.