Created
December 16, 2019 05:02
-
-
Save PhanDungTri/254a601ef3d6c41ed7243a8613c6e129 to your computer and use it in GitHub Desktop.
This file contains 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
const create = async e => { | |
e.preventDefault(); | |
const form = e.target; | |
const formData = new FormData(form); | |
formData.append("image", form.elements["CarImage"].files[0]); | |
await axios.post("api/car", formData); | |
form.reset(); | |
onSubmit(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment