1
0
Fork 0
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:
Thibault Meyer 2016-11-10 16:16:32 +01:00
parent c040f2fbb1
commit a4454f5d0f
No known key found for this signature in database
GPG key ID: BE39A108C4DDA755
22 changed files with 480 additions and 233 deletions

View file

@ -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.