mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 10:48:37 +00:00
feat: Add search bar on user profile page. (#787)
This commit is contained in:
@@ -1579,10 +1579,14 @@ func GetRepositoryByID(id int64) (*Repository, error) {
|
||||
}
|
||||
|
||||
// GetUserRepositories returns a list of repositories of given user.
|
||||
func GetUserRepositories(userID int64, private bool, page, pageSize int) ([]*Repository, error) {
|
||||
func GetUserRepositories(userID int64, private bool, page, pageSize int, orderBy string) ([]*Repository, error) {
|
||||
if len(orderBy) == 0 {
|
||||
orderBy = "updated_unix DESC"
|
||||
}
|
||||
|
||||
sess := x.
|
||||
Where("owner_id = ?", userID).
|
||||
Desc("updated_unix")
|
||||
OrderBy(orderBy)
|
||||
if !private {
|
||||
sess.And("is_private=?", false)
|
||||
}
|
||||
|
@@ -491,7 +491,7 @@ func (u *User) GetOrganizationCount() (int64, error) {
|
||||
|
||||
// GetRepositories returns repositories that user owns, including private repositories.
|
||||
func (u *User) GetRepositories(page, pageSize int) (err error) {
|
||||
u.Repos, err = GetUserRepositories(u.ID, true, page, pageSize)
|
||||
u.Repos, err = GetUserRepositories(u.ID, true, page, pageSize, "")
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user