(data)
| 21 | } |
| 22 | |
| 23 | const onSubmit = async (data) => { |
| 24 | // await delay(2) // simulating network delay |
| 25 | let r = await fetch("http://localhost:3000/", {method: "POST", headers: { |
| 26 | "Content-Type": "application/json", |
| 27 | }, body: JSON.stringify(data)}) |
| 28 | let res = await r.text() |
| 29 | console.log(data, res) |
| 30 | // if(data.username !== "shubham"){ |
| 31 | // setError("myform", {message: "Your form is not in good order because credentials are invalid"}) |
| 32 | // } |
| 33 | // if(data.username === "rohan"){ |
| 34 | // setError("blocked", {message: "Sorry this user is blocked"}) |
| 35 | // } |
| 36 | } |
| 37 | |
| 38 | return ( |
| 39 | <> |
nothing calls this directly
no outgoing calls
no test coverage detected