forked from Ruderverein-Donau-Linz/rowt
add ergo tool
This commit is contained in:
@ -58,12 +58,15 @@ async fn delete(db: &State<SqlitePool>, _admin: AdminUser, user: i32) -> Flash<R
|
||||
}
|
||||
|
||||
#[derive(FromForm)]
|
||||
struct UserEditForm {
|
||||
id: i32,
|
||||
is_guest: bool,
|
||||
is_cox: bool,
|
||||
is_admin: bool,
|
||||
is_tech: bool,
|
||||
pub struct UserEditForm {
|
||||
pub(crate) id: i32,
|
||||
pub(crate) is_guest: bool,
|
||||
pub(crate) is_cox: bool,
|
||||
pub(crate) is_admin: bool,
|
||||
pub(crate) is_tech: bool,
|
||||
pub(crate) dob: Option<String>,
|
||||
pub(crate) weight: Option<String>,
|
||||
pub(crate) sex: Option<String>,
|
||||
}
|
||||
|
||||
#[post("/user", data = "<data>")]
|
||||
@ -80,8 +83,7 @@ async fn update(
|
||||
);
|
||||
};
|
||||
|
||||
user.update(db, data.is_cox, data.is_admin, data.is_guest, data.is_tech)
|
||||
.await;
|
||||
user.update(db, data.into_inner()).await;
|
||||
|
||||
Flash::success(Redirect::to("/admin/user"), "Successfully updated user")
|
||||
}
|
||||
|
Reference in New Issue
Block a user