diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-02-14 15:28:22 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-14 15:28:22 +0800 |
commit | 23aba523b551d20ee2bbc694ae630989bcdeaccd (patch) | |
tree | 61f0aa0e9a50dcbc924b9d4cacdf3e90936ab7a4 /models/star.go | |
parent | 7eb8daffa3181f6bae7aac95d536c68c6bed0e33 (diff) | |
download | gitea-23aba523b551d20ee2bbc694ae630989bcdeaccd.tar.gz gitea-23aba523b551d20ee2bbc694ae630989bcdeaccd.zip |
feat: support search bar on star tab of user profile. (#917)
* feat: support search bar on star tab of user profile.
* fix: update testing.
* fix: Using loadAttributes
* fix: remove empty line.
* remove LOWER
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Diffstat (limited to 'models/star.go')
-rw-r--r-- | models/star.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/star.go b/models/star.go index 39f6eac1f0..7525c8a6fa 100644 --- a/models/star.go +++ b/models/star.go @@ -73,12 +73,12 @@ func (repo *Repository) GetStargazers(page int) ([]*User, error) { // GetStarredRepos returns the repos the user starred. func (u *User) GetStarredRepos(private bool, page, pageSize int, orderBy string) (repos []*Repository, err error) { if len(orderBy) == 0 { - orderBy = "star.id" + orderBy = "updated_unix DESC" } sess := x. Join("INNER", "star", "star.repo_id = repository.id"). Where("star.uid = ?", u.ID). - Desc(orderBy) + OrderBy(orderBy) if !private { sess = sess.And("is_private = ?", false) |