From 90155dbc0fc3eb6abeef3c8fd81f1a509e71c7ec Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 23 Sep 2023 18:26:04 +0200 Subject: [PATCH] fix ci --- src/model/logbook.rs | 26 +++++++++++++------------- src/model/user.rs | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/model/logbook.rs b/src/model/logbook.rs index 2f48c1b..5ded709 100644 --- a/src/model/logbook.rs +++ b/src/model/logbook.rs @@ -46,7 +46,7 @@ pub struct LogToFinalize { pub distance_in_km: i64, pub comments: Option, pub logtype: Option, - pub rower: Vec, + pub rowers: Vec, } #[derive(Serialize, Debug)] @@ -271,10 +271,10 @@ ORDER BY departure DESC let boat = Boat::find_by_id(db, self.boat_id as i32).await.unwrap(); //ok - if log.rower.len() > boat.amount_seats as usize - 1 { + if log.rowers.len() > boat.amount_seats as usize - 1 { return Err(LogbookUpdateError::TooManyRowers( boat.amount_seats as usize, - log.rower.len() + 1, + log.rowers.len() + 1, )); } @@ -296,7 +296,7 @@ ORDER BY departure DESC self.remove_rowers(&mut tx).await; - for rower in &log.rower { + for rower in &log.rowers { Rower::create(&mut tx, self.id, *rower) .await .map_err(|e| LogbookUpdateError::RowerCreateError(*rower, e.to_string()))?; @@ -384,7 +384,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: Vec::new(), + rowers: Vec::new(), }, ) .await @@ -407,7 +407,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: Vec::new(), + rowers: Vec::new(), }, ) .await; @@ -431,7 +431,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: Vec::new(), + rowers: Vec::new(), }, ) .await; @@ -455,7 +455,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: Vec::new(), + rowers: Vec::new(), }, ) .await; @@ -479,7 +479,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: Vec::new(), + rowers: Vec::new(), }, ) .await; @@ -503,7 +503,7 @@ mod test { distance_in_km: None, comments: None, logtype: None, - rower: vec![1], + rowers: vec![1], }, ) .await; @@ -542,7 +542,7 @@ mod test { distance_in_km: 42, comments: Some("Perfect water".into()), logtype: None, - rower: vec![], + rowers: vec![], }, ) .await @@ -565,7 +565,7 @@ mod test { distance_in_km: 42, comments: Some("Perfect water".into()), logtype: None, - rower: vec![], + rowers: vec![], }, ) .await; @@ -589,7 +589,7 @@ mod test { distance_in_km: 42, comments: Some("Perfect water".into()), logtype: None, - rower: vec![1], + rowers: vec![1], }, ) .await; diff --git a/src/model/user.rs b/src/model/user.rs index b8363d4..4de124b 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -494,7 +494,7 @@ mod test { fn test_cox() { let pool = testdb!(); let res = User::cox(&pool).await; - assert_eq!(res.len(), 2); + assert_eq!(res.len(), 3); } #[sqlx::test]