Last active
September 21, 2017 13:43
-
-
Save uno-de-piera/8bfb9ed18fc94cd68f6435bc61cc0565 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
<template> | |
<!-- user form --> | |
</template> | |
<script> | |
export default { | |
methods: { | |
saveUser: function() { | |
let formData = new FormData(document.getElementById(this.formId)); | |
window.axios.post('/users', formData) | |
.then( | |
res => { | |
//process response | |
}, | |
err => { | |
if(err.response.data.errors.email) { | |
//email error from Laravel | |
} | |
} | |
) | |
.catch(err => { | |
//catch error | |
}) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment