mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 13:15:05 +00:00
Error checking and deleting old profile image
This commit is contained in:
@@ -168,10 +168,12 @@ export class edit extends Component {
|
||||
};
|
||||
|
||||
handleImageChange = (event) => {
|
||||
const image = event.target.files[0];
|
||||
const formData = new FormData();
|
||||
formData.append('image', image, image.name);
|
||||
this.props.uploadImage(formData);
|
||||
if (event.target.files[0]) {
|
||||
const image = event.target.files[0];
|
||||
const formData = new FormData();
|
||||
formData.append('image', image, image.name);
|
||||
this.props.uploadImage(formData);
|
||||
}
|
||||
}
|
||||
|
||||
handleEditPicture = () => {
|
||||
|
||||
Reference in New Issue
Block a user