chore: Add chore archiving and unarchiving functionality
This commit is contained in:
parent
b9160bf681
commit
d1d07b84a0
2 changed files with 75 additions and 0 deletions
|
@ -293,3 +293,11 @@ func (r *ChoreRepository) GetChoreDetailByID(c context.Context, choreID int, cir
|
|||
}
|
||||
return &choreDetail, nil
|
||||
}
|
||||
|
||||
func (r *ChoreRepository) ArchiveChore(c context.Context, choreID int, userID int) error {
|
||||
return r.db.WithContext(c).Model(&chModel.Chore{}).Where("id = ? and created_by = ?", choreID, userID).Update("is_active", false).Error
|
||||
}
|
||||
|
||||
func (r *ChoreRepository) UnarchiveChore(c context.Context, choreID int, userID int) error {
|
||||
return r.db.WithContext(c).Model(&chModel.Chore{}).Where("id = ? and created_by = ?", choreID, userID).Update("is_active", true).Error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue