summaryrefslogtreecommitdiffstats
path: root/services/convert
diff options
context:
space:
mode:
authorYarden Shoham <hrsi88@gmail.com>2023-01-17 13:42:32 +0200
committerGitHub <noreply@github.com>2023-01-17 11:42:32 +0000
commite763fab6851c278150a02c983e739a37e17ce988 (patch)
treee307d645d84c624df9eb67f7e76f58ce60b01786 /services/convert
parent9edf80f472e9307d89cab1c22e7c0c185a50deb7 (diff)
downloadgitea-e763fab6851c278150a02c983e739a37e17ce988.tar.gz
gitea-e763fab6851c278150a02c983e739a37e17ce988.zip
Fix pull request API field `closed_at` always being `null` (#22482)
Fix #22480
Diffstat (limited to 'services/convert')
-rw-r--r--services/convert/pull.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/convert/pull.go b/services/convert/pull.go
index db0add6cde..cdf72e7805 100644
--- a/services/convert/pull.go
+++ b/services/convert/pull.go
@@ -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)