Skip to content
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

on FormSubmit, do a post request to above endpoint with formdata in the body #2

Closed
Tracked by #1
CapSap opened this issue Sep 3, 2023 · 2 comments · Fixed by #3
Closed
Tracked by #1

on FormSubmit, do a post request to above endpoint with formdata in the body #2

CapSap opened this issue Sep 3, 2023 · 2 comments · Fixed by #3

Comments

@CapSap
Copy link
Owner

CapSap commented Sep 3, 2023

had some trouble linking up the api route that is successfully creating tickets in zendesk with the form submit.

the trouble i was facing was that the request body from the form, when trying to read this on the server it was a ReadableStream. ( i was using a server action to hit an api route, rather than do all the work in the server action)

After lots of searching around I've realised that I didn't need to have any api route- i can do all the 'POST' request within the server action function.

BUT for the below reasons I think I want a "traditional" client component.

  • i want to do some more fancy client side validation
  • i want to let the user know how many tickets were created, how many were submitted
  • i want to alert the user to any typos before they submit
  • i want to alter the user to any duplicates (i need to do a search and a fetch before user submits form)
@CapSap CapSap mentioned this issue Sep 3, 2023
13 tasks
@CapSap
Copy link
Owner Author

CapSap commented Sep 4, 2023

so i was able to move the route endpoint logic into the server action function and it works! so that's good to know.

Still, I'd like to move back to that more traditional client call, server endpoint route.

@CapSap CapSap mentioned this issue Sep 5, 2023
@CapSap CapSap closed this as completed in #3 Sep 5, 2023
@CapSap
Copy link
Owner Author

CapSap commented Sep 5, 2023

side note; i'll leave as is for now, and revisit when it becomes an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant