vue-media-upload icon indicating copy to clipboard operation
vue-media-upload copied to clipboard

No server error handling?

Open cchas opened this issue 11 months ago • 0 comments

Hey, I think there should be an event so when the axios request fails, an event is triggered.

Something like: const data = await axios.post(this.server, formData) .catch( error => { this.$emit('serverError', error) });

                        if( data ){
                            let addedImage = {url:url, name:data.name, size:files[i].size, type:files[i].type}
                            this.addedMedia.push(addedImage)
    
                            this.$emit('change', this.allMedia)
                            this.$emit('add', addedImage, this.addedMedia)    
                        }

instead of only: const {data} = await axios.post(this.server, formData)

What do you think?

cchas avatar Jul 19 '23 14:07 cchas