diff --git a/crates/oswilno-parking-space/src/lib.rs b/crates/oswilno-parking-space/src/lib.rs index 6009009..4b17988 100644 --- a/crates/oswilno-parking-space/src/lib.rs +++ b/crates/oswilno-parking-space/src/lib.rs @@ -1,11 +1,11 @@ -use actix_web::web::{Data, ServiceConfig}; +use actix_web::web::{scope, Data, ServiceConfig}; use actix_web::{get, HttpResponse}; pub fn mount(config: &mut ServiceConfig) { - config.service(all_parking_spaces); + config.service(scope("/parking_spaces").service(all_parking_spaces)); } -#[get("/ps")] +#[get("/all")] async fn all_parking_spaces(db: Data) -> HttpResponse { use oswilno_contract::parking_spaces; use sea_orm::prelude::*; diff --git a/crates/oswilno-parking-space/templates/all.html b/crates/oswilno-parking-space/templates/all.html new file mode 100644 index 0000000..3fce1ad --- /dev/null +++ b/crates/oswilno-parking-space/templates/all.html @@ -0,0 +1,17 @@ + +{% for parking_space_rent in parking_space_rents -%} +{% if let Some(parking_space) = parking_space_by_id.get(parking_space_rent.parking_space_id) %} +{% if let Some(account) = account_by_id.get(parking_space.account_id) %} + + + +
{{ account.login }}
+
+
+
+
+
+{% endif %} +{% endif %} +{% endfor -%} +