feat: Add search bar on user profile page. (#787)
This commit is contained in:
parent
de81f68d4d
commit
a90a215662
6 changed files with 69 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue