None => user.password_encrypted,
};
- let default_listing_type = ListingType::from_str(&data.default_listing_type)? as i16;
- let default_sort_type = SortType::from_str(&data.default_sort_type)? as i16;
+ let default_listing_type = data.default_listing_type;
+ let default_sort_type = data.default_sort_type;
let user_form = UserForm {
name: user.name,
let user_id = user.map(|u| u.id);
- let (user_view, user_dangerous) = if let Some(auth_user_id) = user_id {
+ let (user_view, user_view_dangerous) = if let Some(auth_user_id) = user_id {
if user_details_id == auth_user_id {
(
None,
// Return the jwt
Ok(GetUserDetailsResponse {
user_view,
- user_view_dangerous: user_dangerous,
+ user_view_dangerous,
follows,
moderates,
comments,
lemmy_db_queries = { path = "../lemmy_db_queries" }
lemmy_db_schema = { path = "../lemmy_db_schema" }
diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] }
-serde = { version = "1.0.118", features = ["derive"] }
\ No newline at end of file
+serde = { version = "1.0.118", features = ["derive"] }
pub struct SaveUserSettings {
pub show_nsfw: bool,
pub theme: String,
- pub default_sort_type: String,
- pub default_listing_type: String,
+ pub default_sort_type: i16,
+ pub default_listing_type: i16,
pub lang: String,
pub avatar: Option<String>,
pub banner: Option<String>,