Reset intervals correctly

This commit is contained in:
jude committed 2023-12-22 16:58:30 +00:00
1 parent 59982df827
commit a2d442bc54
2 files changed
+16 -1

No files matched your search

@@ -235,6 +235,21 @@ pub async fn edit_reminder(
]);
}
}
} else {
sqlx::query!(
"
UPDATE reminders
SET interval_seconds = NULL, interval_days = NULL, interval_months = NULL
WHERE uid = ?
",
reminder.uid
)
.execute(transaction.executor())
.await
.map_err(|e| {
warn!("Error updating reminder interval: {:?}", e);
json!({ "reminder": Option::<Reminder>::None, "errors": vec!["Unknown error"] })
})?;
}
if reminder.channel > 0 {