- let local_user_res = blocking(context.pool(), move |conn| {
- LocalUser::update(conn, local_user_id, &local_user_form)
- })
- .await?;
+ let local_user_form = LocalUserUpdateForm::builder()
+ .email(email)
+ .show_avatars(data.show_avatars)
+ .show_read_posts(data.show_read_posts)
+ .show_new_post_notifs(data.show_new_post_notifs)
+ .send_notifications_to_email(data.send_notifications_to_email)
+ .show_nsfw(data.show_nsfw)
+ .blur_nsfw(data.blur_nsfw)
+ .auto_expand(data.auto_expand)
+ .show_bot_accounts(data.show_bot_accounts)
+ .show_scores(data.show_scores)
+ .default_sort_type(default_sort_type)
+ .default_listing_type(default_listing_type)
+ .theme(theme)
+ .interface_language(data.interface_language.clone())
+ .totp_2fa_secret(totp_2fa_secret)
+ .totp_2fa_url(totp_2fa_url)
+ .open_links_in_new_tab(data.open_links_in_new_tab)
+ .infinite_scroll_enabled(data.infinite_scroll_enabled)
+ .build();
+
+ let local_user_res =
+ LocalUser::update(&mut context.pool(), local_user_id, &local_user_form).await;