diff --git a/src/components/cpmCard.vue b/src/components/cpmCard.vue index 42a2b7a..48962ff 100644 --- a/src/components/cpmCard.vue +++ b/src/components/cpmCard.vue @@ -33,7 +33,6 @@ Comentários -
@@ -50,26 +49,30 @@
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Rerum, magni dicta. Dignissimos doloribus cum, similique corrupti consequatur quod! Deserunt, sequi! - - +
@@ -88,20 +91,43 @@ export default { props: ['cardData'], data:() => ({ cardDataArray: [], - newComent:'' + newComent:'', + url: process.env.VUE_APP_BASE_URL, + }), computed:{ ...mapGetters({ - userData: 'userData' + userData: 'FeedVuex/userData' }) }, methods:{ - - createComent(){ - + createComent(param){ + if(!this.newComent){ + this.$toast.error("Verifique se existe algum campo vazio", "Atenção!", { + position: "topCenter", + }); + } + + else{ + let body = { + comment:this.newComent + } + let eventId = param.id + console.log(this.url + `/comment/${eventId}`, body) + + this.$http.post(this.url + `/comment/${eventId}`, body).then(resp => { + console.log(resp) + }) + + this.$http.post(this.uploadUrl + '/upload/image', fd) + .then(resp => { + console.log(resp) + this.eventForm.img = resp.data + }) + } } }, @@ -112,10 +138,8 @@ export default { } - \ No newline at end of file