allow changing title of planned-event; fixes #52
This commit is contained in:
@ -210,6 +210,7 @@ INNER JOIN trip_details ON planned_event.trip_details_id = trip_details.id",
|
||||
pub async fn update(
|
||||
&self,
|
||||
db: &SqlitePool,
|
||||
name: &str,
|
||||
planned_amount_cox: i32,
|
||||
max_people: i32,
|
||||
notes: Option<&str>,
|
||||
@ -217,7 +218,8 @@ INNER JOIN trip_details ON planned_event.trip_details_id = trip_details.id",
|
||||
is_locked: bool,
|
||||
) {
|
||||
sqlx::query!(
|
||||
"UPDATE planned_event SET planned_amount_cox = ? WHERE id = ?",
|
||||
"UPDATE planned_event SET name = ?, planned_amount_cox = ? WHERE id = ?",
|
||||
name,
|
||||
planned_amount_cox,
|
||||
self.id
|
||||
)
|
||||
|
@ -43,6 +43,7 @@ async fn create(
|
||||
#[derive(FromForm)]
|
||||
struct UpdatePlannedEventForm<'r> {
|
||||
id: i64,
|
||||
name: &'r str,
|
||||
planned_amount_cox: i32,
|
||||
max_people: i32,
|
||||
notes: Option<&'r str>,
|
||||
@ -61,6 +62,7 @@ async fn update(
|
||||
planned_event
|
||||
.update(
|
||||
db,
|
||||
data.name,
|
||||
data.planned_amount_cox,
|
||||
data.max_people,
|
||||
data.notes,
|
||||
|
Reference in New Issue
Block a user