mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 00:58:30 +02:00
[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>
This commit is contained in:
1 parent
131278ff22
commit
d453533beb
28 files changed
+234
-208
No files matched your search
@@ -8,7 +8,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
)
|
||||
|
||||
//UserList is a list of user.
|
||||
@@ -94,12 +93,3 @@ func (users UserList) loadTwoFactorStatus(e Engine) (map[int64]*TwoFactor, error
|
||||
}
|
||||
return tokenMaps, nil
|
||||
}
|
||||
|
||||
//APIFormat return list of users in api format
|
||||
func (users UserList) APIFormat() []*api.User {
|
||||
result := make([]*api.User, 0, len(users))
|
||||
for _, u := range users {
|
||||
result = append(result, u.APIFormat())
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in new issue
Block a user