We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f36966 commit 2a0e37dCopy full SHA for 2a0e37d
templates/components/what/networking/take-json.hbs
@@ -1,8 +1,8 @@
1
-#[derive(FromForm)]
+#[derive(Deserialize)]
2
struct Task { name: String, completed: bool }
3
4
#[post("/", data = "<task>")]
5
-fn new(task: Form<Task>) -> Flash<Redirect> {
+fn new(task: Json<Task>) -> Flash<Redirect> {
6
if task.name.is_empty() {
7
Flash::error(Redirect::to("/"),
8
"Cannot be empty.")
0 commit comments