1
0
Fork 0
forked from forgejo/forgejo

[refactor] Unify the export of user data via API (#15144)

* [refactor] unify how user data is exported via API

* test time via unix timestamp
This commit is contained in:
6543 2021-03-27 17:45:26 +01:00 committed by GitHub
parent f4d27498bd
commit 290cf75f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 117 additions and 97 deletions

View file

@ -31,7 +31,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
URL: issue.APIURL(),
HTMLURL: issue.HTMLURL(),
Index: issue.Index,
Poster: ToUser(issue.Poster, false, false),
Poster: ToUser(issue.Poster, nil),
Title: issue.Title,
Body: issue.Content,
Ref: issue.Ref,
@ -66,9 +66,9 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
}
if len(issue.Assignees) > 0 {
for _, assignee := range issue.Assignees {
apiIssue.Assignees = append(apiIssue.Assignees, ToUser(assignee, false, false))
apiIssue.Assignees = append(apiIssue.Assignees, ToUser(assignee, nil))
}
apiIssue.Assignee = ToUser(issue.Assignees[0], false, false) // For compatibility, we're keeping the first assignee as `apiIssue.Assignee`
apiIssue.Assignee = ToUser(issue.Assignees[0], nil) // For compatibility, we're keeping the first assignee as `apiIssue.Assignee`
}
if issue.IsPull {
if err := issue.LoadPullRequest(); err != nil {