Skip to content

Commit

Permalink
Fix pull request API field closed_at always being null (#22482) (#…
Browse files Browse the repository at this point in the history
…22483)

Backport #22482

Fix #22480
  • Loading branch information
yardenshoham authored Jan 17, 2023
1 parent a32700d commit 45bdeac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/convert/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
},
}

if pr.Issue.ClosedUnix != 0 {
apiPullRequest.Closed = pr.Issue.ClosedUnix.AsTimePtr()
}

gitRepo, err := git.OpenRepository(ctx, pr.BaseRepo.RepoPath())
if err != nil {
log.Error("OpenRepository[%s]: %v", pr.BaseRepo.RepoPath(), err)
Expand Down

0 comments on commit 45bdeac

Please sign in to comment.