mirror of
https://github.com/spikecodes/libreddit.git
synced 2025-12-23 22:12:36 +01:00
Front page config and settings note
This commit is contained in:
@@ -13,6 +13,7 @@ struct SettingsTemplate {
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct SettingsForm {
|
||||
front_page: Option<String>,
|
||||
layout: Option<String>,
|
||||
comment_sort: Option<String>,
|
||||
hide_nsfw: Option<String>,
|
||||
@@ -30,8 +31,8 @@ pub async fn get(req: HttpRequest) -> HttpResponse {
|
||||
pub async fn set(req: HttpRequest, form: Form<SettingsForm>) -> HttpResponse {
|
||||
let mut res = HttpResponse::Found();
|
||||
|
||||
let names = vec!["layout", "comment_sort", "hide_nsfw"];
|
||||
let values = vec![&form.layout, &form.comment_sort, &form.hide_nsfw];
|
||||
let names = vec!["front_page", "layout", "comment_sort", "hide_nsfw"];
|
||||
let values = vec![&form.front_page, &form.layout, &form.comment_sort, &form.hide_nsfw];
|
||||
|
||||
for (i, name) in names.iter().enumerate() {
|
||||
match values[i] {
|
||||
|
||||
Reference in New Issue
Block a user