Merge branch 'staging' into 'main'
allow adding boatdamage from everyone See merge request PhilippHofer/rot!42
This commit is contained in:
commit
44464424de
@ -69,14 +69,14 @@ pub struct FormBoatDamageToAdd<'r> {
|
|||||||
async fn create<'r>(
|
async fn create<'r>(
|
||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
data: Form<FormBoatDamageToAdd<'r>>,
|
data: Form<FormBoatDamageToAdd<'r>>,
|
||||||
coxuser: CoxUser,
|
user: User,
|
||||||
) -> Flash<Redirect> {
|
) -> Flash<Redirect> {
|
||||||
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
|
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
|
||||||
let boatdamage_to_add = BoatDamageToAdd {
|
let boatdamage_to_add = BoatDamageToAdd {
|
||||||
boat_id: data.boat_id,
|
boat_id: data.boat_id,
|
||||||
desc: data.desc,
|
desc: data.desc,
|
||||||
lock_boat: data.lock_boat,
|
lock_boat: data.lock_boat,
|
||||||
user_id_created: coxuser.id as i32,
|
user_id_created: user.id as i32,
|
||||||
};
|
};
|
||||||
match BoatDamage::create(db, boatdamage_to_add).await {
|
match BoatDamage::create(db, boatdamage_to_add).await {
|
||||||
Ok(_) => Flash::success(
|
Ok(_) => Flash::success(
|
||||||
|
Loading…
Reference in New Issue
Block a user