peach-workspace/peach-web/src/routes/settings/theme.rs

17 lines
405 B
Rust

use rouille::Response;
use crate::utils::{theme, theme::Theme};
// ROUTE: /settings/theme/{theme}
/// Set the user-interface theme according to the query parameter value.
pub fn set_theme(theme: String) -> Response {
match theme.as_str() {
"light" => theme::set_theme(Theme::Light),
"dark" => theme::set_theme(Theme::Dark),
_ => (),
}
Response::redirect_303("/")
}