aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorYarden Shoham <hrsi88@gmail.com>2023-01-17 13:41:43 +0200
committerGitHub <noreply@github.com>2023-01-17 11:41:43 +0000
commit45bdeac730f752f0547761d82f4132ae416f0c30 (patch)
tree2686ec65eb2b88915cfa89142542f4de7c310d6e /modules
parenta32700d0fd86dd214ee4d9e8a401533485c66140 (diff)
downloadgitea-45bdeac730f752f0547761d82f4132ae416f0c30.tar.gz
gitea-45bdeac730f752f0547761d82f4132ae416f0c30.zip
Fix pull request API field `closed_at` always being `null` (#22482) (#22483)
Backport #22482 Fix #22480
Diffstat (limited to 'modules')
-rw-r--r--modules/convert/pull.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/convert/pull.go b/modules/convert/pull.go
index 9c31f9bd2c..5eb3cba5a3 100644
--- a/modules/convert/pull.go
+++ b/modules/convert/pull.go
@@ -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)