|
@@ -145,7 +145,7 @@ const ImageUpload = (props) => {
|
|
|
data.append('name', name);
|
|
|
data.append('image', image);
|
|
|
|
|
|
- onChangeUploadedImages(uploadedImages.filter(i => i !== image))
|
|
|
+ onChangeUploadedImages(uploadedImages.filter(i => i !== image));
|
|
|
|
|
|
axios.post(serverURL + "/images/addImage/" + folderParam, data, {})
|
|
|
.then(res => {
|
|
@@ -162,7 +162,13 @@ const ImageUpload = (props) => {
|
|
|
} else {
|
|
|
onChangeUploadedImages(res.data.Image);
|
|
|
}
|
|
|
- }).catch(err => {console.log(err)});
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log('upload failed', err);
|
|
|
+ updatePhotosToUpload([]);
|
|
|
+ setRejectMessages(Array.from(['upload of image ' + image.name + ' failed. Reason: ' + err]));
|
|
|
+ setRejectMessageVisible(true);
|
|
|
+ });
|
|
|
})
|
|
|
}
|
|
|
|