Merge pull request #83 from Jan0660/master

Add route for fetching self for bots and users
This commit is contained in:
Paul Makles
2021-09-14 21:22:34 +01:00
committed by GitHub
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,