use actix_web::web::{Data, ServiceConfig}; use actix_web::{get, HttpResponse}; pub fn mount(config: &mut ServiceConfig) { config.service(all_parking_spaces); } #[get("/ps")] async fn all_parking_spaces(db: Data) -> HttpResponse { use oswilno_contract::prelude::*; use oswilno_contract::*; use parking_spaces::*; use sea_orm::*; let db = db.into_inner(); let spaces: Vec = Entity::find().all(&*db).await.unwrap(); HttpResponse::Ok().json(spaces) }