Fix Param Naming mismatch

This commit is contained in:
Neshura 2023-12-13 19:06:32 +01:00
parent c8ed40c3cc
commit 5c0c03fd7a
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 5 additions and 7 deletions

View file

@ -48,9 +48,7 @@ async fn verify_user_auth(data: &web::Data<AppState>, auth_token: &str, user_tok
// User Endpoints // User Endpoints
#[utoipa::path( #[utoipa::path(
params( request_body = GetUserParams,
schemas::GetUserParams
),
responses( responses(
(status = 200, description = "OK", body = User), (status = 200, description = "OK", body = User),
(status = 403, description = "Unauthorized"), (status = 403, description = "Unauthorized"),
@ -60,7 +58,7 @@ async fn verify_user_auth(data: &web::Data<AppState>, auth_token: &str, user_tok
("api_key" = []) ("api_key" = [])
), ),
)] )]
#[get("/api/v1/user")] #[post("/api/v1/user")]
pub(crate) async fn get_user( pub(crate) async fn get_user(
data: web::Data<AppState>, data: web::Data<AppState>,
params: web::Json<schemas::GetUserParams>, params: web::Json<schemas::GetUserParams>,
@ -118,7 +116,7 @@ pub(crate) async fn get_user(
(status = 500, description = "Internal Server Error") (status = 500, description = "Internal Server Error")
), ),
)] )]
#[post("/api/v1/user")] #[post("/api/v1/user/create")]
pub(crate) async fn create_user( pub(crate) async fn create_user(
data: web::Data<AppState>, data: web::Data<AppState>,
) -> impl Responder { ) -> impl Responder {
@ -320,7 +318,7 @@ pub(crate) async fn update_user(
} }
#[utoipa::path( #[utoipa::path(
request_body = schemas::DeleteUserParams, request_body = DeleteUserParams,
responses( responses(
(status = 200, description = "OK"), (status = 200, description = "OK"),
(status = 403, description = "Unauthorized"), (status = 403, description = "Unauthorized"),

View file

@ -32,7 +32,7 @@ pub struct User {
pub permissions: HashMap<String, bool>, pub permissions: HashMap<String, bool>,
} }
#[derive(Serialize, Deserialize, ToSchema, Debug, IntoParams)] #[derive(Serialize, Deserialize, ToSchema, Debug)]
pub struct GetUserParams { pub struct GetUserParams {
#[schema(example = "abcdef")] #[schema(example = "abcdef")]
pub user_token: String, pub user_token: String,