-
I'm currently working on providing a "ready-to-paste" example code for API submissions. |
Beta Was this translation helpful? Give feedback.
Answered by
tobimori
Apr 11, 2024
Replies: 1 comment
-
This is a brief overview of what to do if you are interested in implementing it yourself. If you set The API schema looks like this: type ApiResponse = {
session: string // This is a session key, used for "sessionless" multi-step requests
success: boolean // Whether the request & validation has been successful so far
step: number // The current step of the submission
redirect: string | null // If the redirect action is used, this contains the URL to redirect to
error: string | null // A global error (e.g. an action failed to run, CSRF validation, etc.)
errors: Record<string, string> // Validation error for each field, with the name="key" as key and error message as value
actions: Record<string, unknown> // Custom data set by an action with setActionData()
} For multi-step forms, you submit each step manually. Include the session key from the previous response with |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tobimori
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a brief overview of what to do if you are interested in implementing it yourself.
If you set
tobimori.dreamform.mode
in your config toapi
, any POST request will send back a JSON response.The API schema looks like this: