Profile edit (WIP)
This commit is contained in:
parent
405aa68526
commit
327b2d0a5b
15 changed files with 174 additions and 46 deletions
|
|
@ -63,13 +63,13 @@ use crate::{
|
|||
};
|
||||
|
||||
#[debug_handler]
|
||||
pub async fn set_user_name(
|
||||
pub async fn update_user(
|
||||
State(connection): State<db::Connection>,
|
||||
Extension(user): Extension<Option<model::User>>,
|
||||
ExtractRon(ron): ExtractRon<common::ron_api::SetProfileName>,
|
||||
ExtractRon(ron): ExtractRon<common::ron_api::UpdateProfile>,
|
||||
) -> Result<StatusCode> {
|
||||
if let Some(user) = user {
|
||||
connection.set_user_name(user.id, &ron.name).await?;
|
||||
// connection.set_user_name(user.id, &ron.name).await?;
|
||||
} else {
|
||||
return Err(ErrorResponse::from(ron_error(
|
||||
StatusCode::UNAUTHORIZED,
|
||||
Loading…
Add table
Add a link
Reference in a new issue