aboutsummaryrefslogtreecommitdiffstats
path: root/internal/thing/repo
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-01 18:44:41 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-01 18:44:41 -0400
commit17326a16a018ae84d274be53b52be9273ef69932 (patch)
treea98d2edfdf8a7738f1825e550f2a085e3d70f74e /internal/thing/repo
parenta6871d420053fa06cebdeccee82752a9f9b99af8 (diff)
downloaddonetick-17326a16a018ae84d274be53b52be9273ef69932.tar.gz
donetick-17326a16a018ae84d274be53b52be9273ef69932.tar.bz2
donetick-17326a16a018ae84d274be53b52be9273ef69932.zip
Update local.yaml to set is_done_tick_dot_com to false, add things history
Diffstat (limited to 'internal/thing/repo')
-rw-r--r--internal/thing/repo/repository.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/thing/repo/repository.go b/internal/thing/repo/repository.go
index 8b2dbaa..a7b1fc9 100644
--- a/internal/thing/repo/repository.go
+++ b/internal/thing/repo/repository.go
@@ -70,9 +70,9 @@ func (r *ThingRepository) DissociateThingWithChore(c context.Context, thingID in
return r.db.WithContext(c).Where("thing_id = ? AND chore_id = ?", thingID, choreID).Delete(&tModel.ThingChore{}).Error
}
-func (r *ThingRepository) GetThingHistoryWithOffset(c context.Context, thingID int, offset int, limit int) ([]*tModel.ThingHistory, error) {
+func (r *ThingRepository) GetThingHistoryWithOffset(c context.Context, thingID int, offset int) ([]*tModel.ThingHistory, error) {
var thingHistory []*tModel.ThingHistory
- if err := r.db.WithContext(c).Model(&tModel.ThingHistory{}).Where("thing_id = ?", thingID).Order("created_at desc").Offset(offset).Limit(limit).Find(&thingHistory).Error; err != nil {
+ if err := r.db.WithContext(c).Model(&tModel.ThingHistory{}).Where("thing_id = ?", thingID).Order("created_at desc").Offset(offset).Limit(10).Find(&thingHistory).Error; err != nil {
return nil, err
}
return thingHistory, nil