aboutsummaryrefslogtreecommitdiffstats
path: root/internal/thing/repo
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-07 03:02:21 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-07 03:02:21 -0400
commita3fa964c585f62ccf4c4113da1dc324839122c88 (patch)
treef189f84015d8327d5d6bc7fb1b97f4362d0be2ec /internal/thing/repo
parent17326a16a018ae84d274be53b52be9273ef69932 (diff)
downloaddonetick-a3fa964c585f62ccf4c4113da1dc324839122c88.tar.gz
donetick-a3fa964c585f62ccf4c4113da1dc324839122c88.tar.bz2
donetick-a3fa964c585f62ccf4c4113da1dc324839122c88.zip
Fix Adaptive Scheduler, Update email handlers, telegram notifications
Diffstat (limited to 'internal/thing/repo')
-rw-r--r--internal/thing/repo/repository.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/thing/repo/repository.go b/internal/thing/repo/repository.go
index a7b1fc9..ad5a92f 100644
--- a/internal/thing/repo/repository.go
+++ b/internal/thing/repo/repository.go
@@ -70,6 +70,10 @@ 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) DissociateChoreWithThing(c context.Context, choreID int) error {
+ return r.db.WithContext(c).Where("chore_id = ?", choreID).Delete(&tModel.ThingChore{}).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(10).Find(&thingHistory).Error; err != nil {