Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
🐛 fix setup/signup avatar uploads (#667)
Browse files Browse the repository at this point in the history
closes TryGhost/Ghost#8375

- `jQuery.ajax` has removed the `.success` and `.error` methods, replacing them with `.done` and `.fail`
  • Loading branch information
kevinansfield authored and kirrg001 committed Apr 24, 2017
1 parent 0c31c6f commit 0d385df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/controllers/setup/two.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -109,7 +109,7 @@ export default Controller.extend(ValidationEngine, {
}
}).then(resolve).catch(reject);
})
.error(reject);
.fail(reject);
});
},

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Expand Down

0 comments on commit 0d385df

Please sign in to comment.