Skip to content

Refactor newsletter form submission to use Fetch API#124

Closed
apoorvpathak wants to merge 1 commit intonestjs:masterfrom
apoorvpathak:issue-99-newsletter
Closed

Refactor newsletter form submission to use Fetch API#124
apoorvpathak wants to merge 1 commit intonestjs:masterfrom
apoorvpathak:issue-99-newsletter

Conversation

@apoorvpathak
Copy link
Copy Markdown

This PR replaces the legacy XMLHttpRequest with the modern Fetch API for handling the newsletter form submission. The update improves code readability, maintainability, and aligns with modern JavaScript best practices.

Changes:

  • Replaced XMLHttpRequest with fetch and async/await

  • Kept all existing functionality intact

  • Improved error handling with try-catch

I tried to keep the changes minimal as this is my first-ever PR to this project. In the future, I plan to enhance the newsletter submission by:

  • Adding a loading spinner for better user experience

  • Displaying an error message if something goes wrong while submitting the email

Looking forward to any feedback and Let me know if you need any refinements!

@apoorvpathak
Copy link
Copy Markdown
Author

hey @kamilmysliwiec when you have some time, could you please have a look at this PR? thanks!

@kamilmysliwiec
Copy link
Copy Markdown
Member

We're in the middle of a major redesign - this website will be entirely revamped soon

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 this pull request may close these issues.

3 participants