Delete unneeded user avatar formData

This commit is contained in:
Luke Bennett 2018-07-17 20:03:16 +01:00
parent 10bd800297
commit ab1a8d1045
No known key found for this signature in database
GPG key ID: A738E9C68D3BF31A

View file

@ -49,13 +49,15 @@ export default class Profile {
saveForm() {
const self = this;
const formData = new FormData(this.form[0]);
const formData = new FormData(this.form.get(0));
const avatarBlob = this.avatarGlCrop.getBlob();
if (avatarBlob != null) {
formData.append('user[avatar]', avatarBlob, 'avatar.png');
}
formData.delete('user[avatar]-trigger');
axios({
method: this.form.attr('method'),
url: this.form.attr('action'),