Changed data import to add alongside rather than removing.

This commit is contained in:
jude
2023-03-24 19:41:34 +00:00
parent 4e0163f2cb
commit 314c72e132
6 changed files with 16 additions and 26 deletions

View File

@ -353,7 +353,7 @@ pub struct TodoCsv {
pub async fn create_reminder(
ctx: &Context,
pool: &Pool<MySql>,
pool: impl sqlx::Executor<'_, Database = Database> + Copy,
guild_id: GuildId,
user_id: UserId,
reminder: Reminder,
@ -450,6 +450,11 @@ pub async fn create_reminder(
// base64 decode error dropped here
let attachment_data = reminder.attachment.as_ref().map(|s| base64::decode(s).ok()).flatten();
let name = if reminder.name.is_empty() { name_default() } else { reminder.name.clone() };
let username = if reminder.username.as_ref().map(|s| s.is_empty()).unwrap_or(true) {
None
} else {
reminder.username
};
let new_uid = generate_uid();
@ -507,7 +512,7 @@ pub async fn create_reminder(
name,
reminder.restartable,
reminder.tts,
reminder.username,
username,
reminder.utc_time,
)
.execute(pool)