style: cargo fmt
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful

This commit is contained in:
Radical 2025-07-10 15:37:45 +02:00
parent e8b8b49643
commit e8a9857e19
13 changed files with 87 additions and 41 deletions

View file

@ -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)?;

View file

@ -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)?;

View file

@ -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")