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:
parent
2f83a1a4fa
commit
535f24545c
2 changed files with 7 additions and 7 deletions
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue