|
|
@ -623,7 +623,7 @@ func FindUserAccessibleRepoIDs(user *user_model.User) ([]int64, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetUserRepositories returns a list of repositories of given user.
|
|
|
|
// GetUserRepositories returns a list of repositories of given user.
|
|
|
|
func GetUserRepositories(opts *SearchRepoOptions) ([]*repo_model.Repository, int64, error) { |
|
|
|
func GetUserRepositories(opts *SearchRepoOptions) (RepositoryList, int64, error) { |
|
|
|
if len(opts.OrderBy) == 0 { |
|
|
|
if len(opts.OrderBy) == 0 { |
|
|
|
opts.OrderBy = "updated_unix DESC" |
|
|
|
opts.OrderBy = "updated_unix DESC" |
|
|
|
} |
|
|
|
} |
|
|
@ -646,6 +646,6 @@ func GetUserRepositories(opts *SearchRepoOptions) ([]*repo_model.Repository, int |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sess = sess.Where(cond).OrderBy(opts.OrderBy.String()) |
|
|
|
sess = sess.Where(cond).OrderBy(opts.OrderBy.String()) |
|
|
|
repos := make([]*repo_model.Repository, 0, opts.PageSize) |
|
|
|
repos := make(RepositoryList, 0, opts.PageSize) |
|
|
|
return repos, count, db.SetSessionPagination(sess, opts).Find(&repos) |
|
|
|
return repos, count, db.SetSessionPagination(sess, opts).Find(&repos) |
|
|
|
} |
|
|
|
} |
|
|
|