From 7fab1257a9e4e589783a91a4b5feac3fb02cb841 Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sat, 31 Dec 2022 13:06:02 +0200 Subject: [PATCH] will fix later :) --- backend/Cargo.toml | 1 - backend/src/driver_data.rs | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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, }