diff options
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<D: Storage>(db: D, endpoints: IndiewebEndpoints) -> impl Filter< .and(warp::any().map(inject_db)) .then(|content: (Option<serde_json::Value>, Option<serde_json::Value>, 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<D: Storage, T: hyper::client::connect::Connect + Clone + Send if body.user["type"][0] != "h-card" || body.first_post["type"][0] != "h-entry" { return Err(FrontendError::with_code(StatusCode::BAD_REQUEST, "user and first_post should be an h-card and an h-entry").into()); } - db.set_setting("site_name", user.me.as_str(), &body.blog_name) + db.set_setting(crate::database::Settings::SiteName, user.me.as_str(), &body.blog_name) .await .map_err(FrontendError::from)?; @@ -401,7 +401,7 @@ pub fn catchall<D: Storage>(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; |