1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: add ability to regenerate summaries

fix: database cascade settings
chore: debug log mode for gorm queries is back
This commit is contained in:
Ferdinand Mütsch
2020-11-06 17:09:41 +01:00
parent e6a04cc76d
commit e269b37b0e
14 changed files with 194 additions and 36 deletions

View File

@@ -51,3 +51,12 @@ func (r *SummaryRepository) GetLatestByUser() ([]*models.Summary, error) {
}
return summaries, nil
}
func (r *SummaryRepository) DeleteByUser(userId string) error {
if err := r.db.
Where("user_id = ?", userId).
Delete(models.Summary{}).Error; err != nil {
return err
}
return nil
}