From 3932daa26360d6e03807381d0b8ffa2d0e704847 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 17 Apr 2023 20:56:53 +0200 Subject: Validate income date from body --- src/model/income.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/model') diff --git a/src/model/income.rs b/src/model/income.rs index 7bc888f..ef97b56 100644 --- a/src/model/income.rs +++ b/src/model/income.rs @@ -1,3 +1,4 @@ +use chrono::NaiveDate; use serde::Serialize; #[derive(Debug, Clone, sqlx::FromRow, Serialize)] @@ -27,14 +28,12 @@ pub struct Form { pub struct Create { pub user_id: i64, pub amount: i64, - pub month: u32, - pub year: i32, + pub date: NaiveDate, } #[derive(Debug)] pub struct Update { pub user_id: i64, pub amount: i64, - pub month: u32, - pub year: i32, + pub date: NaiveDate, } -- cgit v1.2.3