diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-02 01:40:09 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-02 01:40:09 -0400 |
commit | 6845fd54f10f9f7c2b500255af578cf5078ff3f5 (patch) | |
tree | d32f9d01dacf453740ea42707565dcdf8f3a856f /internal/notifier/service | |
parent | e40c2a84cd93683aa7e4d98d4ada7923e32a3e33 (diff) | |
download | donetick-6845fd54f10f9f7c2b500255af578cf5078ff3f5.tar.gz donetick-6845fd54f10f9f7c2b500255af578cf5078ff3f5.tar.bz2 donetick-6845fd54f10f9f7c2b500255af578cf5078ff3f5.zip |
Add validation to deleteThing endpoint to prevent deletion of things with associated tasks
Diffstat (limited to 'internal/notifier/service')
-rw-r--r-- | internal/notifier/service/planner.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/notifier/service/planner.go b/internal/notifier/service/planner.go index 22502ab..c8b4ea6 100644 --- a/internal/notifier/service/planner.go +++ b/internal/notifier/service/planner.go @@ -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 { |