Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkros1245 committed Apr 4, 2024
1 parent ce751b0 commit 6917ac5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/src/handlers/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
};

#[debug_handler]
pub async fn get_all_devices(
pub async fn get_devices(
State(pool): State<SqlitePool>,
Authentication(account_id): Authentication,
) -> Result<Json<Vec<Device>>, (StatusCode, String)> {
Expand Down Expand Up @@ -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<SqlitePool>,
Authentication(account_id): Authentication,
Json(device): Json<Device>,
Expand Down
8 changes: 4 additions & 4 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -122,7 +122,7 @@ mod tests {
async fn generate_device(app: &mut RouterIntoService<Body>, 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(
Expand Down

0 comments on commit 6917ac5

Please sign in to comment.