Add validation to deleteThing endpoint to prevent deletion of things with associated tasks

This commit is contained in:
Mo Tarbin 2024-07-02 01:40:09 -04:00
parent e40c2a84cd
commit 6845fd54f1
2 changed files with 13 additions and 0 deletions

View file

@ -48,6 +48,9 @@ func (n *NotificationPlanner) GenerateNotifications(c context.Context, chore *ch
var mt *chModel.NotificationMetadata
if err := json.Unmarshal([]byte(*chore.NotificationMetadata), &mt); err != nil {
log.Error("Error unmarshalling notification metadata", err)
return false
}
if chore.NextDueDate == nil {
return true
}
if mt.DueDate {