Advertisement
andersonalmada

Untitled

Aug 22nd, 2021
1,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. inserirPosts: function() {
  2.       axios
  3.         .post(this.baseURI, {
  4.           name: this.name,
  5.           price: this.price,
  6.         })
  7.         .then((result) => {
  8.           if (result.status == 201) {
  9.             alert("Inserido com sucesso !!");
  10.             this.handleFileUpload(result.data.id);
  11.           }
  12.         })
  13.         .catch((error) => {
  14.           if (error.response.status == 400) {
  15.             alert("Dados incorretos !!");
  16.           } else {
  17.             alert("Problema desconhecido !!");
  18.           }
  19.         });
  20.     },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement