From 9f18b593f9b47796c78862c0c77e605ae5edf420 Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sat, 31 Dec 2022 23:18:02 +0200 Subject: [PATCH] Fixed an error message that just said "deez" to something bettar --- backend/src/driver_data.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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)