use query_as instead of manual mapping

This commit is contained in:
2023-07-31 16:33:44 +02:00
parent dc4b4b3499
commit 32e6148844
4 changed files with 19 additions and 104 deletions

View File

@ -172,10 +172,7 @@ ORDER BY amount_seats DESC
#[cfg(test)]
mod test {
use crate::{
model::{
boat::{Boat, BoatToAdd},
location::Location,
},
model::boat::{Boat, BoatToAdd},
testdb,
};
@ -333,7 +330,6 @@ mod test {
fn test_succ_update() {
let pool = testdb!();
let boat = Boat::find_by_id(&pool, 1).await.unwrap();
let location = Location::find_by_id(&pool, 1).await.unwrap();
let update = BoatToUpdate {
name: "my-new-boat-name",
amount_seats: 3,
@ -356,7 +352,6 @@ mod test {
fn test_failed_update() {
let pool = testdb!();
let boat = Boat::find_by_id(&pool, 1).await.unwrap();
let location = Location::find_by_id(&pool, 1).await.unwrap();
let update = BoatToUpdate {
name: "my-new-boat-name",
amount_seats: 3,