Browse Source

Fix pull request API field `closed_at` always being `null` (#22482)

Fix #22480
pull/22486/head
Yarden Shoham 3 years ago committed by GitHub
parent
commit
e763fab685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      services/convert/pull.go

4
services/convert/pull.go

@ -88,6 +88,10 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u @@ -88,6 +88,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)

Loading…
Cancel
Save