0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 fix setup/signup avatar uploads (#667)

closes https://github.com/TryGhost/Ghost/issues/8375

- `jQuery.ajax` has removed the `.success` and `.error` methods, replacing them with `.done` and `.fail`
This commit is contained in:
Kevin Ansfield 2017-04-24 10:28:30 +01:00 committed by Katharina Irrgang
parent 2f83a1a4fa
commit 535f24545c
2 changed files with 7 additions and 7 deletions

View file

@ -98,8 +98,8 @@ export default Controller.extend(ValidationEngine, {
return new Promise((resolve, reject) => {
image.formData = {};
image.submit()
.success((response) => {
return image.submit()
.done((response) => {
let usersUrl = this.get('ghostPaths.url').api('users', user.id.toString());
user.image = response;
@ -109,7 +109,7 @@ export default Controller.extend(ValidationEngine, {
}
}).then(resolve).catch(reject);
})
.error(reject);
.fail(reject);
});
},

View file

@ -156,17 +156,17 @@ export default Controller.extend(ValidationEngine, {
return this.get('session.user').then((user) => {
return new Promise((resolve, reject) => {
image.formData = {};
image.submit()
.success((response) => {
return image.submit()
.done((response) => {
let usersUrl = this.get('ghostPaths.url').api('users', user.id.toString());
user.image = response;
this.get('ajax').put(usersUrl, {
return this.get('ajax').put(usersUrl, {
data: {
users: [user]
}
}).then(resolve).catch(reject);
})
.error(reject);
.fail(reject);
});
});
}