From 54914782c7632e041919746e80d3f802f6601a63 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 23 Mar 2022 05:01:14 +0300 Subject: Make the settings in the database a strong type --- src/frontend/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index b594fc6..1069b92 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -270,7 +270,7 @@ pub fn homepage(db: D, endpoints: IndiewebEndpoints) -> impl Filter< .and(warp::any().map(inject_db)) .then(|content: (Option, Option, StatusCode), endpoints: IndiewebEndpoints, host: Authority, db: D| async move { let owner = format!("https://{}/", host.as_str()); - let blog_name = db.get_setting("site_name", &owner).await + let blog_name = db.get_setting(crate::database::Settings::SiteName, &owner).await .unwrap_or_else(|_| "Kitty Box!".to_string()); let feeds = db.get_channels(&owner).await.unwrap_or_default(); match content { @@ -323,7 +323,7 @@ pub fn onboarding(db: D, endpoints: IndiewebEndpoints) -> impl Filter< .and(warp::any().map(inject_db)) .then(|content: (String, String, StatusCode), endpoints: IndiewebEndpoints, host: Authority, db: D| async move { let owner = format!("https://{}/", host.as_str()); - let blog_name = db.get_setting("site_name", &owner).await + let blog_name = db.get_setting(crate::database::Settings::SiteName, &owner).await .unwrap_or_else(|_| "Kitty Box!".to_string()); let feeds = db.get_channels(&owner).await.unwrap_or_default(); let (title, content, code) = content; -- cgit 1.4.1