Fix Adaptive Scheduler, Update email handlers, telegram notifications

This commit is contained in:
Mo Tarbin 2024-07-07 03:02:21 -04:00
parent 17326a16a0
commit a3fa964c58
9 changed files with 193 additions and 35 deletions

View file

@ -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 {