feat: allow getting user profile via json api

This commit is contained in:
DJMrTV 2025-06-06 12:49:16 +02:00
commit 82a81422d6
6 changed files with 21 additions and 8 deletions

View file

@ -0,0 +1 @@
pub mod profile;

View file

@ -0,0 +1,10 @@
use rocket::serde::json::Json;
use rocket::{get, State};
use crate::account::account::Auth;
use crate::nnid::people::{build_profile, GetOwnProfileData};
use crate::Pool;
#[get("/api/v2/users/@me/profile")]
pub async fn get_own_profile(pool: &State<Pool>, auth: Auth<true>) -> Json<GetOwnProfileData> {
Json(build_profile(auth.into()))
}