mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 09:55:20 +02:00
Rewrite XORM queries
This commit is contained in:
parent
c040f2fbb1
commit
a4454f5d0f
22 changed files with 480 additions and 233 deletions
|
@ -72,7 +72,10 @@ func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
|
|||
// ListAccessTokens returns a list of access tokens belongs to given user.
|
||||
func ListAccessTokens(uid int64) ([]*AccessToken, error) {
|
||||
tokens := make([]*AccessToken, 0, 5)
|
||||
return tokens, x.Where("uid=?", uid).Desc("id").Find(&tokens)
|
||||
return tokens, x.
|
||||
Where("uid=?", uid).
|
||||
Desc("id").
|
||||
Find(&tokens)
|
||||
}
|
||||
|
||||
// UpdateAccessToken updates information of access token.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue