diff options
Diffstat (limited to 'models/issue_stopwatch.go')
-rw-r--r-- | models/issue_stopwatch.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/models/issue_stopwatch.go b/models/issue_stopwatch.go index 8047f122b5..ca92141157 100644 --- a/models/issue_stopwatch.go +++ b/models/issue_stopwatch.go @@ -33,9 +33,14 @@ func getStopwatch(e Engine, userID, issueID int64) (sw *Stopwatch, exists bool, } // GetUserStopwatches return list of all stopwatches of a user -func GetUserStopwatches(userID int64) (sws *Stopwatches, err error) { - sws = new(Stopwatches) - err = x.Where("stopwatch.user_id = ?", userID).Find(sws) +func GetUserStopwatches(userID int64, listOptions ListOptions) (*Stopwatches, error) { + sws := new(Stopwatches) + sess := x.Where("stopwatch.user_id = ?", userID) + if listOptions.Page != 0 { + sess = listOptions.setSessionPagination(sess) + } + + err := sess.Find(sws) if err != nil { return nil, err } |