summaryrefslogtreecommitdiffstats
path: root/modules/convert/issue.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-10-17 06:23:08 +0200
committerGitHub <noreply@github.com>2020-10-17 00:23:08 -0400
commitd453533beb197d25b25530dc5f0e3c3c0742d8d1 (patch)
tree6d66e1163333344d91af63e9ab50a82367470b8f /modules/convert/issue.go
parent131278ff222f1a8580f20e6bbdff405341403042 (diff)
downloadgitea-d453533beb197d25b25530dc5f0e3c3c0742d8d1.tar.gz
gitea-d453533beb197d25b25530dc5f0e3c3c0742d8d1.zip
[Refactor] Move APIFormat functions into convert package (#12856)
* USER APIFormat -> ToUser * Migrate more and mark APIFormat deprecated * models.Comment APIFormat() -> convert.ToComment * models.Release APIFormat() -> convert.ToRelease * models.Attachments APIFormat() -> convert.ToReleaseAttachments * models.CommitStatus APIFormat() -> convert.ToCommitStatus * finish migration to convert.ToUser * Move Test * Imprufe Test * fix test Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/convert/issue.go')
-rw-r--r--modules/convert/issue.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/convert/issue.go b/modules/convert/issue.go
index 724ec8ffcf..f34656b47c 100644
--- a/modules/convert/issue.go
+++ b/modules/convert/issue.go
@@ -31,7 +31,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
URL: issue.APIURL(),
HTMLURL: issue.HTMLURL(),
Index: issue.Index,
- Poster: issue.Poster.APIFormat(),
+ Poster: ToUser(issue.Poster, false, false),
Title: issue.Title,
Body: issue.Content,
Labels: ToLabelList(issue.Labels),
@@ -65,9 +65,9 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
}
if len(issue.Assignees) > 0 {
for _, assignee := range issue.Assignees {
- apiIssue.Assignees = append(apiIssue.Assignees, assignee.APIFormat())
+ apiIssue.Assignees = append(apiIssue.Assignees, ToUser(assignee, false, false))
}
- apiIssue.Assignee = issue.Assignees[0].APIFormat() // For compatibility, we're keeping the first assignee as `apiIssue.Assignee`
+ apiIssue.Assignee = ToUser(issue.Assignees[0], false, false) // For compatibility, we're keeping the first assignee as `apiIssue.Assignee`
}
if issue.IsPull {
if err := issue.LoadPullRequest(); err != nil {