diff --git a/backend/Cargo.toml b/backend/Cargo.toml index b0fea81..11881d1 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] dotenv = "0.15" -chrono = "0.2.25" common = { path = "../common"} yew = { version = "0.20.0", features = ["csr"] } anyhow = "1.0" diff --git a/backend/src/driver_data.rs b/backend/src/driver_data.rs index 0623d73..514af56 100644 --- a/backend/src/driver_data.rs +++ b/backend/src/driver_data.rs @@ -1,13 +1,17 @@ use crate::pog::SqlStruct; use async_trait::async_trait; -use chrono::NaiveDate; +use serde::{Deserialize, Serialize}; +use sqlx::types::chrono::NaiveDate; use sqlx::{types::Json, PgPool}; +#[derive(Serialize, Deserialize, Debug, Clone, sqlx::FromRow)] pub struct Driver { pub id: i32, pub name: String, pub address: String, + #[serde_as(as = "Json")] pub reg_date: NaiveDate, + #[serde_as(as = "Json")] pub birthdate: NaiveDate, }