Last active
January 19, 2022 10:24
-
-
Save tjmonsi/7c82bafa5fbdb8e4c6e49ebd17adec51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async handleSubmit (e) { | |
| // after nung console.log(values) | |
| const { username, password } = values; | |
| // window.fetch MDN docs | |
| const response = await fetch('http://localhost:8080/auth/login', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-type': 'application/json' | |
| }, | |
| body: JSON.stringify({ | |
| username: username, | |
| password: password | |
| }) | |
| }) | |
| const result = await response.json() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment