Skip to content

Commit ff30217

Browse files
committed
More changes
1 parent 00703d0 commit ff30217

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

models/issues/issue_watch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func GetIssueWatchers(ctx context.Context, issueID int64, listOptions db.ListOpt
105105
And("`user`.prohibit_login = ?", false).
106106
Join("INNER", "`user`", "`user`.id = `issue_watch`.user_id")
107107

108-
if listOptions.Page != 0 {
108+
if listOptions.Page > 0 {
109109
sess = db.SetSessionPagination(sess, &listOptions)
110110
watches := make([]*IssueWatch, 0, listOptions.PageSize)
111111
return watches, sess.Find(&watches)

models/issues/label.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func GetLabelsByRepoID(ctx context.Context, repoID int64, sortType string, listO
390390
sess.Asc("name")
391391
}
392392

393-
if listOptions.Page != 0 {
393+
if listOptions.Page > 0 {
394394
sess = db.SetSessionPagination(sess, &listOptions)
395395
}
396396

@@ -462,7 +462,7 @@ func GetLabelsByOrgID(ctx context.Context, orgID int64, sortType string, listOpt
462462
sess.Asc("name")
463463
}
464464

465-
if listOptions.Page != 0 {
465+
if listOptions.Page > 0 {
466466
sess = db.SetSessionPagination(sess, &listOptions)
467467
}
468468

models/issues/stopwatch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func GetUIDsAndStopwatch(ctx context.Context) ([]*UserStopwatch, error) {
9696
func GetUserStopwatches(ctx context.Context, userID int64, listOptions db.ListOptions) ([]*Stopwatch, error) {
9797
sws := make([]*Stopwatch, 0, 8)
9898
sess := db.GetEngine(ctx).Where("stopwatch.user_id = ?", userID)
99-
if listOptions.Page != 0 {
99+
if listOptions.Page > 0 {
100100
sess = db.SetSessionPagination(sess, &listOptions)
101101
}
102102

models/repo/pushmirror.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func DeletePushMirrors(ctx context.Context, opts PushMirrorOptions) error {
9999
// GetPushMirrorsByRepoID returns push-mirror information of a repository.
100100
func GetPushMirrorsByRepoID(ctx context.Context, repoID int64, listOptions db.ListOptions) ([]*PushMirror, int64, error) {
101101
sess := db.GetEngine(ctx).Where("repo_id = ?", repoID)
102-
if listOptions.Page != 0 {
102+
if listOptions.Page > 0 {
103103
sess = db.SetSessionPagination(sess, &listOptions)
104104
mirrors := make([]*PushMirror, 0, listOptions.PageSize)
105105
count, err := sess.FindAndCount(&mirrors)

models/user/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func GetUserFollowers(ctx context.Context, u, viewer *User, listOptions db.ListO
330330
And("`user`.type=?", UserTypeIndividual).
331331
And(isUserVisibleToViewerCond(viewer))
332332

333-
if listOptions.Page != 0 {
333+
if listOptions.Page > 0 {
334334
sess = db.SetSessionPagination(sess, &listOptions)
335335

336336
users := make([]*User, 0, listOptions.PageSize)
@@ -352,7 +352,7 @@ func GetUserFollowing(ctx context.Context, u, viewer *User, listOptions db.ListO
352352
And("`user`.type IN (?, ?)", UserTypeIndividual, UserTypeOrganization).
353353
And(isUserVisibleToViewerCond(viewer))
354354

355-
if listOptions.Page != 0 {
355+
if listOptions.Page > 0 {
356356
sess = db.SetSessionPagination(sess, &listOptions)
357357

358358
users := make([]*User, 0, listOptions.PageSize)

0 commit comments

Comments
 (0)