forked from forgejo/forgejo
[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:
parent
131278ff22
commit
d453533beb
28 changed files with 234 additions and 208 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue