mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Added profile update action from profile page
refs https://github.com/TryGhost/members.js/issues/20 - Updates profile update action name in Profile Page - Adds new action to update member info from profile page if member is logged in
This commit is contained in:
parent
197be15e63
commit
680572f499
2 changed files with 14 additions and 1 deletions
ghost/portal/src/components
|
@ -178,6 +178,19 @@ export default class ParentContainer extends React.Component {
|
|||
});
|
||||
} else if (action === 'editBilling') {
|
||||
await this.GhostApi.member.editBilling();
|
||||
} else if (action === 'updateMember') {
|
||||
const {email, name, subscribed} = data;
|
||||
const member = await this.GhostApi.member.update({email, name, subscribed});
|
||||
if (!member) {
|
||||
this.setState({
|
||||
action: 'updateMember:failed'
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
action: 'updateMember:success',
|
||||
member: member
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.setState({
|
||||
|
|
|
@ -28,7 +28,7 @@ export default class AccountProfilePage extends React.Component {
|
|||
|
||||
onProfileSave(e) {
|
||||
const {email, name} = this.state;
|
||||
this.context.onAction('profileSave', {email, name});
|
||||
this.context.onAction('updateMember', {email, name});
|
||||
}
|
||||
|
||||
renderAccountFooter() {
|
||||
|
|
Loading…
Add table
Reference in a new issue