From 963470eb84e925e775b1307db0b5d9b19d8c4100 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 17 Jan 2023 10:57:01 +0000 Subject: [PATCH] Fix pull request API field `closed_at` always being `null` --- modules/convert/pull.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/convert/pull.go b/modules/convert/pull.go index 9c31f9bd2c182..5eb3cba5a3840 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)