-
Notifications
You must be signed in to change notification settings - Fork 534
feat: give access to underlying data as object and as form data object #2605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: give access to underlying data as object and as form data object #2605
Conversation
|
Looks good to me! |
|
Okay, I will add the tests in the coming hours. |
|
@MeiKatz Any updates on this? |
|
I am still trying to write the tests for this. Until now I wasn't successful with this |
No problem! Shall I write them? |
|
This would be great. I guess I can learn from you how to do this in the future if there is another time I like to contribute. |
| await page.fill('#name', 'John Doe') | ||
| await page.getByRole('button', { name: 'Test getData()' }).click() | ||
|
|
||
| const result = consoleMessages.messages.find((msg) => msg.includes('getData result:')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, consoleMessages was the missing piece. I didn't know about this and that I could listen to console.log() this way.
<Form />is a great addition to InertiaJS. But it would be greater if I could use it for sending manual requests to my api and benefit from the other features offered by<Form />. Currently there is no good way for accessing either the form element itself or the data managed by the Form component. I don't want to useuseForm()and have to manually handle the state of my input fields. Getting access to the form data as FormData object or as an plain old JS object would be great.I currently omitted the tests. If the feature is accepted I will add them.