diff --git a/backend/src/driver_data.rs b/backend/src/driver_data.rs index 36e089b..1d10bad 100644 --- a/backend/src/driver_data.rs +++ b/backend/src/driver_data.rs @@ -3,7 +3,7 @@ use actix_web::{get, web, HttpResponse, Responder}; use async_trait::async_trait; use chrono::NaiveDate; use serde::{Deserialize, Serialize}; -use sqlx::{types::Json, PgPool}; +use sqlx::PgPool; #[derive(Serialize, Deserialize, Debug, Clone, sqlx::FromRow)] pub struct Driver { @@ -14,10 +14,6 @@ pub struct Driver { pub birthdate: NaiveDate, } -pub struct Row { - pub id: i32, - pub person: Json, -} #[async_trait] impl SqlStruct for Driver { async fn add(&self, pool: &PgPool) -> anyhow::Result { @@ -43,7 +39,7 @@ pub async fn list_all(db_pool: web::Data) -> impl Responder { let drivers = sqlx::query_as!(Driver, "SELECT * FROM drivers") .fetch_all(db_pool.get_ref()) .await - .expect("deez"); + .expect("Could not fetch anything from the DB D:"); HttpResponse::Ok() .content_type("application/json") .json(drivers)