Compare commits
No commits in common. "6e41758104cd63c5ac6a326cd34224f8a95a0169" and "c916381fb06035f65b4ade18aaef181a135d49bb" have entirely different histories.
6e41758104
...
c916381fb0
@ -105,7 +105,6 @@ pub struct EventUpdate<'a> {
|
|||||||
pub notes: Option<&'a str>,
|
pub notes: Option<&'a str>,
|
||||||
pub always_show: bool,
|
pub always_show: bool,
|
||||||
pub is_locked: bool,
|
pub is_locked: bool,
|
||||||
pub trip_type_id: Option<i64>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Event {
|
impl Event {
|
||||||
@ -245,12 +244,11 @@ WHERE trip_details.id=?
|
|||||||
let was_already_cancelled = tripdetails.max_people == 0;
|
let was_already_cancelled = tripdetails.max_people == 0;
|
||||||
|
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"UPDATE trip_details SET max_people = ?, notes = ?, always_show = ?, is_locked = ?, trip_type_id = ? WHERE id = ?",
|
"UPDATE trip_details SET max_people = ?, notes = ?, always_show = ?, is_locked = ? WHERE id = ?",
|
||||||
update.max_people,
|
update.max_people,
|
||||||
update.notes,
|
update.notes,
|
||||||
update.always_show,
|
update.always_show,
|
||||||
update.is_locked,
|
update.is_locked,
|
||||||
update.trip_type_id,
|
|
||||||
self.trip_details_id
|
self.trip_details_id
|
||||||
)
|
)
|
||||||
.execute(db)
|
.execute(db)
|
||||||
|
@ -238,7 +238,6 @@ mod test {
|
|||||||
notes: event.notes.as_deref(),
|
notes: event.notes.as_deref(),
|
||||||
always_show: event.always_show,
|
always_show: event.always_show,
|
||||||
is_locked: event.is_locked,
|
is_locked: event.is_locked,
|
||||||
trip_type_id: None,
|
|
||||||
};
|
};
|
||||||
event.update(&pool, &cancel_update).await;
|
event.update(&pool, &cancel_update).await;
|
||||||
|
|
||||||
@ -268,7 +267,6 @@ mod test {
|
|||||||
notes: event.notes.as_deref(),
|
notes: event.notes.as_deref(),
|
||||||
always_show: event.always_show,
|
always_show: event.always_show,
|
||||||
is_locked: event.is_locked,
|
is_locked: event.is_locked,
|
||||||
trip_type_id: None,
|
|
||||||
};
|
};
|
||||||
event.update(&pool, &update).await;
|
event.update(&pool, &update).await;
|
||||||
assert!(Notification::for_user(&pool, &rower).await.is_empty());
|
assert!(Notification::for_user(&pool, &rower).await.is_empty());
|
||||||
|
@ -49,7 +49,6 @@ struct UpdateEventForm<'r> {
|
|||||||
notes: Option<&'r str>,
|
notes: Option<&'r str>,
|
||||||
always_show: bool,
|
always_show: bool,
|
||||||
is_locked: bool,
|
is_locked: bool,
|
||||||
trip_type: Option<i64>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[put("/planned-event", data = "<data>")]
|
#[put("/planned-event", data = "<data>")]
|
||||||
@ -65,7 +64,6 @@ async fn update(
|
|||||||
notes: data.notes,
|
notes: data.notes,
|
||||||
always_show: data.always_show,
|
always_show: data.always_show,
|
||||||
is_locked: data.is_locked,
|
is_locked: data.is_locked,
|
||||||
trip_type_id: data.trip_type,
|
|
||||||
};
|
};
|
||||||
match Event::find_by_id(db, data.id).await {
|
match Event::find_by_id(db, data.id).await {
|
||||||
Some(planned_event) => {
|
Some(planned_event) => {
|
||||||
|
@ -220,7 +220,6 @@
|
|||||||
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=event.planned_amount_cox, required=true, min='0') }}
|
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=event.planned_amount_cox, required=true, min='0') }}
|
||||||
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=event.id,checked=event.always_show) }}
|
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=event.id,checked=event.always_show) }}
|
||||||
{{ macros::checkbox(label='Gesperrt', name='is_locked', id=event.id,checked=event.is_locked) }}
|
{{ macros::checkbox(label='Gesperrt', name='is_locked', id=event.id,checked=event.is_locked) }}
|
||||||
{{ macros::select(label='Typ', name='trip_type', data=trip_types, default='Reguläre Ausfahrt', selected_id=event.trip_type_id) }}
|
|
||||||
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=event.notes) }}
|
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=event.notes) }}
|
||||||
<input value="Speichern" class="btn btn-primary" type="submit" />
|
<input value="Speichern" class="btn btn-primary" type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user