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/controller/incomes.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/controller/incomes.rs') diff --git a/src/controller/incomes.rs b/src/controller/incomes.rs index b7fb3ed..cc66ed6 100644 --- a/src/controller/incomes.rs +++ b/src/controller/incomes.rs @@ -97,8 +97,7 @@ pub async fn create( if !db::incomes::defined_at( &wallet.pool, income.user_id, - income.month, - income.year, + income.date, ) .await .is_empty() @@ -180,8 +179,7 @@ pub async fn update( let existing_incomes = db::incomes::defined_at( &wallet.pool, income.user_id, - income.month, - income.year, + income.date, ) .await; if existing_incomes.into_iter().any(|eid| eid != id) { -- cgit v1.2.3