Hotfix - rocket_example

This commit is contained in:
Billy Chan 2021-09-06 19:01:32 +08:00 committed by Chris Tsang
parent 26cd0846d2
commit 691221e714

View File

@ -49,7 +49,7 @@ async fn create(conn: Connection<Db>, post_form: Form<post::Model>) -> Flash<Red
}
#[post("/<id>", data = "<post_form>")]
async fn update(conn: Connection<Db>, id: i64, post_form: Form<post::Model>) -> Flash<Redirect> {
async fn update(conn: Connection<Db>, id: i32, post_form: Form<post::Model>) -> Flash<Redirect> {
let post: post::ActiveModel = Post::find_by_id(id)
.one(&conn)
.await
@ -91,7 +91,7 @@ async fn list(conn: Connection<Db>, flash: Option<FlashMessage<'_>>) -> Template
}
#[get("/<id>")]
async fn edit(conn: Connection<Db>, id: i64) -> Template {
async fn edit(conn: Connection<Db>, id: i32) -> Template {
let post: Option<post::Model> = Post::find_by_id(id)
.one(&conn)
.await