diff options
author | Joris | 2023-04-17 20:56:53 +0200 |
---|---|---|
committer | Joris | 2023-04-17 20:56:53 +0200 |
commit | 3932daa26360d6e03807381d0b8ffa2d0e704847 (patch) | |
tree | 099f92c176ba783bccc5c307927e1effe7c2cd9c /src/controller | |
parent | 8dcb9c6fff82f9e353e0f92b417dd803199f4257 (diff) |
Validate income date from body
Diffstat (limited to 'src/controller')
-rw-r--r-- | src/controller/incomes.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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) { |