mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
Addin g withUpdateEmailAddress
This commit is contained in:
@@ -26,6 +26,7 @@ export default {
|
||||
'UpdateAssetSettingsResponse',
|
||||
'UpdateAssetStatusResponse',
|
||||
'UpdateSettingsResponse',
|
||||
'ChangePasswordResponse'
|
||||
'ChangePasswordResponse',
|
||||
'UpdateEmailAddressResponse'
|
||||
),
|
||||
};
|
||||
|
||||
@@ -321,6 +321,27 @@ const SetUsernameFragment = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const withUpdateEmailAddress = withMutation(
|
||||
gql`
|
||||
mutation UpdateEmailAddress($input: UpdateEmailAddressInput!) {
|
||||
updateEmailAddress(input: $input) {
|
||||
...UpdateEmailAddressResponse
|
||||
}
|
||||
}
|
||||
`,
|
||||
{
|
||||
props: ({ mutate }) => ({
|
||||
updateEmailAdress: input => {
|
||||
return mutate({
|
||||
variables: {
|
||||
input,
|
||||
},
|
||||
});
|
||||
},
|
||||
}),
|
||||
}
|
||||
);
|
||||
|
||||
export const withChangeUsername = withMutation(
|
||||
gql`
|
||||
mutation ChangeUsername($id: ID!, $username: String!) {
|
||||
|
||||
@@ -27,5 +27,6 @@ export {
|
||||
withSetCommentStatus,
|
||||
withChangePassword,
|
||||
withChangeUsername,
|
||||
withUpdateEmailAddress,
|
||||
} from 'coral-framework/graphql/mutations';
|
||||
export { compose } from 'recompose';
|
||||
|
||||
@@ -3,10 +3,15 @@ import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'plugin-api/beta/client/hocs';
|
||||
import Profile from '../components/Profile';
|
||||
import { notify } from 'coral-framework/actions/notification';
|
||||
import { withChangeUsername } from 'plugin-api/beta/client/hocs';
|
||||
import {
|
||||
withChangeUsername,
|
||||
withUpdateEmailAddress,
|
||||
} from 'plugin-api/beta/client/hocs';
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({ notify }, dispatch);
|
||||
|
||||
export default compose(connect(null, mapDispatchToProps), withChangeUsername)(
|
||||
Profile
|
||||
);
|
||||
export default compose(
|
||||
connect(null, mapDispatchToProps),
|
||||
withChangeUsername,
|
||||
withUpdateEmailAddress
|
||||
)(Profile);
|
||||
|
||||
Reference in New Issue
Block a user