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

View file

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