Skip to content

Commit

Permalink
=_="
Browse files Browse the repository at this point in the history
  • Loading branch information
shiroyashik committed Jul 26, 2024
1 parent 3ff68fc commit 442dc29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/figura/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use anyhow_http::{http_error_ret, response::Result};
use axum::{
body::Bytes, extract::{Path, State}, response::{IntoResponse, Response}
body::Bytes, extract::{Path, State}, response::IntoResponse, Json
};
use dashmap::DashMap;
use reqwest::StatusCode;
Expand All @@ -24,7 +24,7 @@ use super::types::S2CMessage;
pub async fn user_info(
Path(uuid): Path<Uuid>,
State(state): State<AppState>,
) -> Response {
) -> impl IntoResponse {
tracing::info!("Receiving profile information for {}", uuid);

let formatted_uuid = format_uuid(&uuid);
Expand All @@ -33,7 +33,7 @@ pub async fn user_info(

let auth_system = match state.user_manager.get_by_uuid(&uuid) {
Some(d) => d.auth_system.to_string(),
None => return (StatusCode::NO_CONTENT, "not sculptor user".to_string()).into_response(), //(StatusCode::NOT_FOUND, "not found".to_string()).into_response(),
None => return (StatusCode::NO_CONTENT, "not sculptor user".to_string()), //(StatusCode::NOT_FOUND, "not found".to_string()).into_response(),
};

let mut user_info_response = json!({
Expand Down Expand Up @@ -82,7 +82,7 @@ pub async fn user_info(
}
}
}
(StatusCode::OK, user_info_response.to_string()).into_response()
(StatusCode::OK, Json(user_info_response).to_string())
}

pub async fn download_avatar(Path(uuid): Path<Uuid>) -> Result<Vec<u8>> {
Expand Down

0 comments on commit 442dc29

Please sign in to comment.