mirror of
				https://gitcode.com/gitea/gitea.git
				synced 2025-10-31 08:28:38 +08:00 
			
		
		
		
	Fix pull request API field closed_at always being null (#22482)
				
					
				
			Fix #22480
This commit is contained in:
		| @ -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()) | 	gitRepo, err := git.OpenRepository(ctx, pr.BaseRepo.RepoPath()) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Error("OpenRepository[%s]: %v", pr.BaseRepo.RepoPath(), err) | 		log.Error("OpenRepository[%s]: %v", pr.BaseRepo.RepoPath(), err) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Yarden Shoham
					Yarden Shoham