Reset intervals correctly

This commit is contained in:
jude 2023-11-12 17:17:22 +00:00
parent 17192b0f89
commit a476f43f28
2 changed files with 16 additions and 1 deletions

@ -1 +1 @@
Subproject commit 8ba7a39ce532907b845c54dd3b54bf2a4c7a04e9
Subproject commit d068782596bb85d883a594633e9b516c1bc428fc

View File

@ -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 {