add planned mod
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled

This commit is contained in:
2025-05-22 13:06:26 +02:00
parent bc6244bc03
commit a42e0b3ed3
25 changed files with 122 additions and 93 deletions

View File

@ -1,16 +1,19 @@
use rocket::{
FromForm, Route, State,
form::Form,
get, post,
response::{Flash, Redirect},
routes, FromForm, Route, State,
routes,
};
use sqlx::SqlitePool;
use crate::model::{
event::Event,
log::Log,
trip::{self, CoxHelpError, Trip, TripDeleteError, TripHelpDeleteError, TripUpdateError},
tripdetails::{TripDetails, TripDetailsToAdd},
planned::{
event::Event,
trip::{self, CoxHelpError, Trip, TripDeleteError, TripHelpDeleteError, TripUpdateError},
tripdetails::{TripDetails, TripDetailsToAdd},
},
user::{AllowedToUpdateTripToAlwaysBeShownUser, ErgoUser, SteeringUser, User},
};
@ -22,7 +25,7 @@ async fn create_ergo(
) -> Flash<Redirect> {
let trip_details_id = TripDetails::create(db, data.into_inner()).await;
let trip_details = TripDetails::find_by_id(db, trip_details_id).await.unwrap(); //Okay, bc just
//created
//created
Trip::new_own_ergo(db, &cox, trip_details).await; //TODO: fix
Flash::success(Redirect::to("/planned"), "Ausfahrt erfolgreich erstellt.")
@ -37,7 +40,7 @@ async fn create(
) -> Flash<Redirect> {
let trip_details_id = TripDetails::create(db, data.into_inner()).await;
let trip_details = TripDetails::find_by_id(db, trip_details_id).await.unwrap(); //Okay, bc just
//created
//created
Trip::new_own(db, &cox, trip_details).await; //TODO: fix
Flash::success(Redirect::to("/planned"), "Ausfahrt erfolgreich erstellt.")
@ -216,7 +219,7 @@ mod test {
};
use sqlx::SqlitePool;
use crate::{model::trip::Trip, testdb};
use crate::{model::planned::trip::Trip, testdb};
#[sqlx::test]
fn test_trip_create() {