Add GET /users/@me

This commit is contained in:
Jan0660
2021-09-12 00:01:30 +00:00
parent 0b0249f544
commit 405f45d0f7
2 changed files with 11 additions and 0 deletions

9
src/routes/users/fetch_self.rs Executable file
View File

@@ -0,0 +1,9 @@
use crate::database::*;
use crate::util::result::{Result};
use rocket::serde::json::Value;
#[get("/@me")]
pub async fn req(user: User) -> Result<Value> {
Ok(json!(user))
}

View File

@@ -14,10 +14,12 @@ mod get_default_avatar;
mod open_dm;
mod remove_friend;
mod unblock_user;
mod fetch_self;
pub fn routes() -> Vec<Route> {
routes![
// User Information
fetch_self::req,
fetch_user::req,
edit_user::req,
change_username::req,