mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
Add GET /users/@me
This commit is contained in:
9
src/routes/users/fetch_self.rs
Executable file
9
src/routes/users/fetch_self.rs
Executable 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))
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user