diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-02-03 12:03:49 +0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-02-03 12:03:49 +0800 |
commit | e2de16065ab0f1b3a5a56a7c805eb6ad6d9aac59 (patch) | |
tree | 7ea39d690c1e11851ef42751dcb124e6f00d771f /models/star.go | |
parent | bf6f61cc690978bcad416ace8e8da2418602cbf3 (diff) | |
download | gitea-e2de16065ab0f1b3a5a56a7c805eb6ad6d9aac59.tar.gz gitea-e2de16065ab0f1b3a5a56a7c805eb6ad6d9aac59.zip |
refactor: set default order by recently star.
Diffstat (limited to 'models/star.go')
-rw-r--r-- | models/star.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/models/star.go b/models/star.go index d7366f37b5..fd08c61fa6 100644 --- a/models/star.go +++ b/models/star.go @@ -74,7 +74,8 @@ func (repo *Repository) GetStargazers(page int) ([]*User, error) { func (u *User) GetStarredRepos(private bool) (repos []*Repository, err error) { sess := x. Join("INNER", "star", "star.repo_id = repository.id"). - Where("star.uid = ?", u.ID) + Where("star.uid = ?", u.ID). + Desc("star.id") if !private { sess = sess.And("is_private = ?", false) |