(e)
| 15 | } |
| 16 | |
| 17 | const handleSubmit = (e) => { |
| 18 | e.preventDefault(); |
| 19 | |
| 20 | |
| 21 | if (email === "") { |
| 22 | seterror("**E-mail is Required!"); |
| 23 | } else if (!validEmail(email)) { |
| 24 | seterror("**Enter a valid E-mail!"); |
| 25 | } |
| 26 | else { |
| 27 | // Make the POST request using Axios |
| 28 | axios |
| 29 | .post("/api/subscribes", { email }) |
| 30 | .then((response) => { |
| 31 | // Handle the success response here |
| 32 | console.log(response.data); |
| 33 | setSubscriptionSuccess(true); |
| 34 | }) |
| 35 | .catch((error) => { |
| 36 | // Handle the error here |
| 37 | console.error(error); |
| 38 | }); |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | const handleEmailChange = (e) => { |
| 43 | setEmail(e.target.value); |
nothing calls this directly
no test coverage detected