From 6917ac50db7cfb786451a390f52e03953cd221d1 Mon Sep 17 00:00:00 2001 From: darkros Date: Thu, 4 Apr 2024 14:22:48 +0200 Subject: [PATCH] Fixed test --- backend/src/handlers/devices.rs | 4 ++-- backend/src/main.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/handlers/devices.rs b/backend/src/handlers/devices.rs index 72ed6e87..372fff5c 100644 --- a/backend/src/handlers/devices.rs +++ b/backend/src/handlers/devices.rs @@ -7,7 +7,7 @@ use crate::{ }; #[debug_handler] -pub async fn get_all_devices( +pub async fn get_devices( State(pool): State, Authentication(account_id): Authentication, ) -> Result>, (StatusCode, String)> { @@ -64,7 +64,7 @@ pub async fn create_device( } #[debug_handler] -pub async fn delete_smart_device( +pub async fn delete_device( State(pool): State, Authentication(account_id): Authentication, Json(device): Json, diff --git a/backend/src/main.rs b/backend/src/main.rs index 7cbe43d9..f99dce45 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -41,9 +41,9 @@ fn app(pool: SqlitePool) -> Router { .route("/tasks/all", get(get_tasks)) .route("/tasks/create", post(create_task)) .route("/tasks/delete", post(delete_task)) - .route("/devices/all", get(get_all_smart_devices)) - .route("/devices/create", post(create_smart_device)) - .route("/devices/delete", post(delete_smart_device)) + .route("/devices/all", get(get_devices)) + .route("/devices/create", post(create_device)) + .route("/devices/delete", post(delete_device)) .route("/accounts/register", post(register_account)) .route("/accounts/login", post(login_to_account)) .with_state(pool) @@ -122,7 +122,7 @@ mod tests { async fn generate_device(app: &mut RouterIntoService, auth_token: String) -> Device { let request = Request::builder() .method(Method::POST) - .uri("/device/create") + .uri("/devices/create") .header("Content-Type", "application/json") .header("X-Auth-Token", auth_token.clone()) .body(Body::from(