Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
fix: patch user field (#63)
Browse files Browse the repository at this point in the history
* fix: patch user field

* fix: fix lint
  • Loading branch information
Mini256 authored Feb 19, 2021
1 parent a24dd7c commit ef2a5e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/events/issue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function handleIssueCommentEvent(
await pullService.syncOpenPRLastCommentTime({
pull: {
...pullKey,
...issue,
user: issue.user,
},
last_comment_author: comment.user,
last_comment_time: comment.updated_at,
Expand Down
11 changes: 7 additions & 4 deletions src/events/pullRequest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function handlePullRequestReviewEvent(
case "submitted":
case "edited":
await commentService.syncPullRequestReview({
...context.pullRequest(),
...pullKey,
// TODO: Patch the review update time.
// Notice: The payload of pull request review does not include update time. The update time of
// pull request will be changed due to review operations.
Expand Down Expand Up @@ -131,7 +131,7 @@ export async function handlePullRequestReviewCommentEvent(
commentService: ICommentService,
pullService: IPullService
) {
const { action, comment, pull_request } = context.payload;
const { action, comment, pull_request: pullRequest } = context.payload;
const pullKey = context.pullRequest();

switch (action) {
Expand All @@ -142,13 +142,16 @@ export async function handlePullRequestReviewCommentEvent(
...comment,
});
await pullService.syncOpenPRLastCommentTime({
pull: context.pullRequest(),
pull: {
...pullKey,
user: pullRequest.user,
},
last_comment_time: comment.updated_at,
last_comment_author: comment.user,
});
await pullService.syncPullRequestUpdateTime(
pullKey,
pull_request.updated_at
pullRequest.updated_at
);
break;
}
Expand Down
87 changes: 0 additions & 87 deletions test/index.test.ts

This file was deleted.

0 comments on commit ef2a5e8

Please sign in to comment.