Skip to content

Commit 2a0e37d

Browse files
authored
Fix incorrect JSON handling code on Networking page (#1087)
1 parent 5f36966 commit 2a0e37d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/components/what/networking/take-json.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#[derive(FromForm)]
1+
#[derive(Deserialize)]
22
struct Task { name: String, completed: bool }
33

44
#[post("/", data = "<task>")]
5-
fn new(task: Form<Task>) -> Flash<Redirect> {
5+
fn new(task: Json<Task>) -> Flash<Redirect> {
66
if task.name.is_empty() {
77
Flash::error(Redirect::to("/"),
88
"Cannot be empty.")

0 commit comments

Comments
 (0)