From 133b00a2ceab864cf67df2f86a86f328b4d43155 Mon Sep 17 00:00:00 2001 From: jude Date: Sat, 17 Sep 2022 12:50:16 +0100 Subject: [PATCH] Patch compilation against live schema --- Cargo.lock | 2 +- Cargo.toml | 2 +- web/src/routes/dashboard/user.rs | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b40a56..bd6d6e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2145,7 +2145,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "reminder_rs" -version = "1.6.5" +version = "1.6.6" dependencies = [ "base64", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 4e9c580..02393ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder_rs" -version = "1.6.5" +version = "1.6.6" authors = ["jellywx "] edition = "2018" diff --git a/web/src/routes/dashboard/user.rs b/web/src/routes/dashboard/user.rs index 882621a..6cd7013 100644 --- a/web/src/routes/dashboard/user.rs +++ b/web/src/routes/dashboard/user.rs @@ -61,10 +61,13 @@ pub async fn get_user_info( .member(&ctx.inner(), user_id) .await; - let timezone = sqlx::query!("SELECT timezone FROM users WHERE user = ?", user_id) - .fetch_one(pool.inner()) - .await - .map_or(None, |q| Some(q.timezone)); + let timezone = sqlx::query!( + "SELECT IFNULL(timezone, 'UTC') AS timezone FROM users WHERE user = ?", + user_id + ) + .fetch_one(pool.inner()) + .await + .map_or(None, |q| Some(q.timezone)); let user_info = UserInfo { name: cookies