Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inserirPosts: function() {
- axios
- .post(this.baseURI, {
- name: this.name,
- price: this.price,
- })
- .then((result) => {
- if (result.status == 201) {
- alert("Inserido com sucesso !!");
- this.handleFileUpload(result.data.id);
- }
- })
- .catch((error) => {
- if (error.response.status == 400) {
- alert("Dados incorretos !!");
- } else {
- alert("Problema desconhecido !!");
- }
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement