Fix urlencoding when jumping to unknown ID
This commit is contained in:
parent
13ce4d0611
commit
6ad8426e7f
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1200,6 +1200,7 @@ dependencies = [
|
|||
"mime",
|
||||
"printpdf",
|
||||
"serde",
|
||||
"serde_urlencoded",
|
||||
"serde_variant",
|
||||
"sqlx",
|
||||
"thiserror",
|
||||
|
|
|
@ -25,6 +25,7 @@ maud = { version = "0.26.0", features = ["actix-web"] }
|
|||
mime = "0.3.17"
|
||||
printpdf = "0.7.0"
|
||||
serde = { version = "1.0.203", features = ["serde_derive"] }
|
||||
serde_urlencoded = "0.7.1"
|
||||
serde_variant = "0.1.3"
|
||||
sqlx = { version = "0.7.4", features = ["runtime-tokio", "postgres", "uuid", "time"] }
|
||||
thiserror = "1.0.61"
|
||||
|
|
|
@ -75,6 +75,10 @@ async fn jump(
|
|||
}) {
|
||||
Ok(web::Redirect::to(format!("/{prefix}/{id}")).see_other())
|
||||
} else {
|
||||
Ok(web::Redirect::to(format!("/items/add?name={id}")).see_other())
|
||||
Ok(web::Redirect::to(format!(
|
||||
"/items/add?{}",
|
||||
serde_urlencoded::to_string([("name", &id)])?
|
||||
))
|
||||
.see_other())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue