style: cargo fmt
This commit is contained in:
parent
e8b8b49643
commit
e8a9857e19
13 changed files with 87 additions and 41 deletions
|
@ -1,6 +1,6 @@
|
|||
use ::uuid::Uuid;
|
||||
use actix_web::{HttpRequest, HttpResponse, get, post, web};
|
||||
use serde::Deserialize;
|
||||
use ::uuid::Uuid;
|
||||
|
||||
pub mod uuid;
|
||||
|
||||
|
@ -51,13 +51,17 @@ struct UserReq {
|
|||
///
|
||||
/// ### Responses
|
||||
/// 200 Success
|
||||
///
|
||||
///
|
||||
/// 404 Not Found
|
||||
///
|
||||
///
|
||||
/// 400 Bad Request (usually means users are already friends)
|
||||
///
|
||||
#[post("/friends")]
|
||||
pub async fn post(req: HttpRequest, json: web::Json<UserReq>, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
||||
pub async fn post(
|
||||
req: HttpRequest,
|
||||
json: web::Json<UserReq>,
|
||||
data: web::Data<Data>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
let headers = req.headers();
|
||||
|
||||
let auth_header = get_auth_header(headers)?;
|
||||
|
|
|
@ -10,7 +10,11 @@ use crate::{
|
|||
};
|
||||
|
||||
#[delete("/friends/{uuid}")]
|
||||
pub async fn delete(req: HttpRequest, path: web::Path<(Uuid,)>, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
||||
pub async fn delete(
|
||||
req: HttpRequest,
|
||||
path: web::Path<(Uuid,)>,
|
||||
data: web::Data<Data>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
let headers = req.headers();
|
||||
|
||||
let auth_header = get_auth_header(headers)?;
|
||||
|
|
|
@ -10,8 +10,8 @@ use crate::{
|
|||
utils::{get_auth_header, global_checks},
|
||||
};
|
||||
|
||||
mod guilds;
|
||||
mod friends;
|
||||
mod guilds;
|
||||
|
||||
pub fn web() -> Scope {
|
||||
web::scope("/me")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue