forked from jmug/stoatchat
Add GET /users/@me
This commit is contained in:
1 parent
0b0249f544
commit
405f45d0f7
2 files changed
+11
No files matched your search
Executable
+9
@@ -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