You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when someone signs up for an account, they can spam the button which accumulates api calls to our backend and makes a lot of user accounts in our database. This is bad behavior. The user should only be able to press the button once and/or make one api call with the sign up form before the form is cleared. This is not isolated to just the sign up form. Imagine that an Admin could delete users. If someone spams that button, only the first deletion would be successful while the other calls would result in errors – which could affect our frontend and backend if not handled correctly.
We want you to explore the world of api throttling with a custom React hook https://react.dev/reference/react/hooks. It's okay if you’re not familiar with hooks, we’re here to help.
Pointers
This is a challenging ticket so here’s a few pointers:
The hook should take in / wrap a function call.
It should differentiate between a “first” api call and any subsequent calls.
Managing a state for when an api call is happening so we can display something in the frontend (i.e a Spinner, or disable the button)
Testing
Once you made a throttling hook, try to add it to our existing buttons and see if it works!
The text was updated successfully, but these errors were encountered:
Description
Currently when someone signs up for an account, they can spam the button which accumulates api calls to our backend and makes a lot of user accounts in our database. This is bad behavior. The user should only be able to press the button once and/or make one api call with the sign up form before the form is cleared. This is not isolated to just the sign up form. Imagine that an Admin could delete users. If someone spams that button, only the first deletion would be successful while the other calls would result in errors – which could affect our frontend and backend if not handled correctly.
We want you to explore the world of api throttling with a custom React hook https://react.dev/reference/react/hooks. It's okay if you’re not familiar with hooks, we’re here to help.
Pointers
This is a challenging ticket so here’s a few pointers:
Testing
Once you made a throttling hook, try to add it to our existing buttons and see if it works!
The text was updated successfully, but these errors were encountered: