diff options
author | 6543 <6543@obermui.de> | 2020-10-17 06:23:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-17 00:23:08 -0400 |
commit | d453533beb197d25b25530dc5f0e3c3c0742d8d1 (patch) | |
tree | 6d66e1163333344d91af63e9ab50a82367470b8f /routers/api/v1/repo/issue_subscription.go | |
parent | 131278ff222f1a8580f20e6bbdff405341403042 (diff) | |
download | gitea-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 'routers/api/v1/repo/issue_subscription.go')
-rw-r--r-- | routers/api/v1/repo/issue_subscription.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_subscription.go b/routers/api/v1/repo/issue_subscription.go index f0df0976fb..2bbd72299a 100644 --- a/routers/api/v1/repo/issue_subscription.go +++ b/routers/api/v1/repo/issue_subscription.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/routers/api/v1/utils" ) @@ -276,6 +277,10 @@ func GetIssueSubscribers(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "GetUsersByIDs", err) return } + apiUsers := make([]*api.User, 0, len(users)) + for i := range users { + apiUsers[i] = convert.ToUser(users[i], ctx.IsSigned, false) + } - ctx.JSON(http.StatusOK, users.APIFormat()) + ctx.JSON(http.StatusOK, apiUsers) } |