Replies: 1 comment
-
Depending on how complex your senario is, you may be able to just use Otherwise, if you have control over the names of the fields, you could use something like: #[derive(Debug, FromForm)]
pub struct Fields<'r> {
field: &'r str,
}
#[derive(Debug, FromForm)]
pub struct Levels {
level: u8,
}
#[derive(Debug, FromForm)]
pub struct Forms<'r> {
fields: Option<Fields<'r>>,
levels: Option<Levels>,
} The level field would now be |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to implement a form that is to be filled progressively.
My idea is to use different structs with more and more fields and forward if fields are missing for example:
But it fails on the first route (
field_post
) because the form is missing a field and returns an error 422 instead of forwarding tolevel_post
.Did I miss something or it's not something that can be done?
Thank you for any help.
Beta Was this translation helpful? Give feedback.
All reactions