Skip to content

Commit

Permalink
Shorten the submit handler name
Browse files Browse the repository at this point in the history
Since we abstracted the use case logic we can use simpler names that only describe the actions on this abstraction layer.
  • Loading branch information
bespoyasov committed Jan 21, 2022
1 parent cbb7a50 commit 80ebc00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function App() {
const { user } = useUserStore();
const { cart } = useCartStore();

async function handleSubmitByValidatingDataAndCreatingOrder(e) {
async function handleSubmit(e) {
e.preventDefault();
setStatus("loading");

Expand All @@ -69,7 +69,7 @@ function App() {
if (!error) {
if (status === "idle") {
return (
<form onSubmit={handleSubmitByValidatingDataAndCreatingOrder}>
<form onSubmit={handleSubmit}>
<UserInfo user={user} />
<ProductList products={cart.products} />
<Coupon />
Expand Down

0 comments on commit 80ebc00

Please sign in to comment.