Преглед изворни кода

marge -> sineIn, sineUp and profile

Svetlana пре 5 година
родитељ
комит
44569b3daa

+ 4 - 9
package-lock.json

@@ -5731,8 +5731,7 @@
         },
         "ansi-regex": {
           "version": "2.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -6084,8 +6083,7 @@
         },
         "safe-buffer": {
           "version": "5.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -6132,7 +6130,6 @@
         "strip-ansi": {
           "version": "3.0.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -6171,13 +6168,11 @@
         },
         "wrappy": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "yallist": {
           "version": "3.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         }
       }
     },

+ 17 - 0
src/actions/user/changeEmail.js

@@ -0,0 +1,17 @@
+import * as actionTypes from './../../constants/user';
+
+export const changeEmailRequest = payload => {
+    console.log('Inside the changeEMAIL action', payload);
+    return {
+        type: actionTypes.CHANGE_EMAIL_REQUEST,
+        payload
+    };
+}
+export const changeEmailSuccess = payload => ({
+    type: actionTypes.CHANGE_EMAIL_REQUEST_SUCCESS,
+    payload
+});
+export const changeEmailFailure = error => ({
+    type: actionTypes.CHANGE_EMAIL_REQUEST_FAILURE,
+    error
+});

+ 17 - 0
src/actions/user/changePassword.js

@@ -0,0 +1,17 @@
+import * as actionTypes from './../../constants/user';
+
+export const changePasswordRequest = payload => {
+    console.log('Inside the changePassword action', payload);
+    return {
+        type: actionTypes.CHANGE_PASSWORD_REQUEST,
+        payload
+    };
+}
+export const changePasswordSuccess = payload => ({
+    type: actionTypes.CHANGE_PASSWORD_REQUEST_SUCCESS,
+    payload
+});
+export const changePasswordFailure = error => ({
+    type: actionTypes.CHANGE_PASSWORD_REQUEST_FAILURE,
+    error
+});

+ 17 - 0
src/actions/user/changelogin.js

@@ -0,0 +1,17 @@
+import * as actionTypes from './../../constants/user';
+
+export const changeLoginRequest = payload => {
+    console.log('Inside the changeLogin action', payload);
+    return {
+        type: actionTypes.CHANGE_LOGIN_REQUEST,
+        payload
+    };
+}
+export const changeLoginSuccess = payload => ({
+    type: actionTypes.CHANGE_LOGIN_REQUEST_SUCCESS,
+    payload
+});
+export const changeLoginFailure = error => ({
+    type: actionTypes.CHANGE_LOGIN_REQUEST_FAILURE,
+    error
+});

+ 25 - 0
src/components/admin/deleteUser/DeleteUserForm/index.js

@@ -0,0 +1,25 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Field, reduxForm } from 'redux-form';
+
+import formInput from '../../../common/formInput';
+
+class DeleteUserForm extends React.Component {
+
+    render() {
+        return (
+            <form>
+                <Field name="name" type="name" placeholder="Enter login" component={formInput} />
+                <button
+                    type="button" className="link link--btn right"        
+                    >
+                    Search
+                </button>
+            </form >
+        )
+    }
+}
+
+export default reduxForm({
+    form: "deleteUserForm",
+})(DeleteUserForm);

+ 31 - 0
src/components/admin/deleteUser/index.js

@@ -0,0 +1,31 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { bindActionCreators } from 'redux'
+import DeleteUserForm from './DeleteUserForm/index'
+
+
+
+class ProfilePage extends React.Component {
+    
+
+    render() {
+       
+        return (
+            <div>
+                <input type="file"/>
+                <DeleteUserForm></DeleteUserForm>
+            </div>
+            
+        )
+    }
+
+}
+
+const
+    mapStateToProps = state => ({
+
+    });
+
+const mapDispatchToProps = dispatch => bindActionCreators({}, dispatch);
+
+export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);

+ 2 - 1
src/components/public/Header.js

@@ -28,9 +28,10 @@ export default class Header extends React.Component {
                         {/* TODO: admin-only ! */}
                         <li class="nav-item dropdown">
                             <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-                                Dropdown
+                                Menu Admina
                                     </a>
                             <div class="dropdown-menu" aria-labelledby="navbarDropdown">
+                                <Link onClick={this.handleClick} class="nav-link font-ci font-ci-bold " to={routes.DELETE_USER}>Delete</Link>
                                 <a class="dropdown-item" href="#">Action</a>
                                 <a class="dropdown-item" href="#">Another action</a>
                                 <div class="dropdown-divider"></div>

+ 44 - 0
src/components/user/ProfilePage/ChangeEmailForm/index.js

@@ -0,0 +1,44 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Field, reduxForm } from 'redux-form';
+
+import formInput from '../../../common/formInput';
+
+class ChangeEmailForm extends React.Component {
+
+    submit = ({email}) => {
+        const {actions:{changeEmailRequest},data:{_id},token } = this.props
+        console.log(_id, email,token);
+
+        changeEmailRequest({
+            token,
+           _id,
+            email
+        })
+        
+    }
+
+    render() {
+        const { children, handleSubmit, actions:{changeEmailRequest}, handlers: {  handleClick, handleClicks }, data, token } = this.props;
+        const { submit}=this
+        return (
+            <form onSubmit={handleSubmit(submit)} >
+                <Field name="email" type="email" placeholder="Enter new login" component={formInput} />
+                <button
+                    type="button" className="link link--btn right"  onClick={
+                        function() {
+                        handleClicks();
+                            handleSubmit(submit)();
+                        }    
+                    
+                    }>
+                    Change
+                </button>
+            </form >
+        )
+    }
+}
+
+export default reduxForm({
+    form: "changeEmailForm",
+})(ChangeEmailForm);

+ 24 - 4
src/components/user/ProfilePage/ChangeLoginForm/index.js

@@ -6,13 +6,33 @@ import formInput from '../../../common/formInput';
 
 class ChangeLoginForm extends React.Component {
 
+    submit = ({ name}) => {
+        const {actions:{changeLoginRequest},data:{_id},token } = this.props
+        console.log(_id, name,token);
+
+        changeLoginRequest({
+            token,
+           _id,
+            name
+        })
+        
+    }
+
     render() {
-        // const { children, handleSubmit, handlers: { handleClick, submit } } = this.props;
+        const { children, handleSubmit, actions:{changeLoginRequest}, handlers: {  handleClick }, data, token } = this.props;
+        const { submit}=this
+        console.log( data)
         return (
-            <form  >
-                <Field name="login" type="email" placeholder="Enter new login" component={formInput} />
+            <form onSubmit={handleSubmit(submit)} >
+                <Field name="name" type="email" placeholder="Enter new login" component={formInput} />
                 <button
-                    type="button" className="link link--btn right" >
+                    type="button" className="link link--btn right"  onClick={
+                        function() {
+                        handleClick();
+                            handleSubmit(submit)();
+                        }    
+                    
+                    }>
                     Change
                 </button>
             </form >

+ 47 - 0
src/components/user/ProfilePage/changePassword/index.js

@@ -0,0 +1,47 @@
+import React from 'react';
+import { Field, reduxForm } from 'redux-form';
+
+import formInput from '../../../common/formInput';
+
+class ChangePasswordForm extends React.Component {
+
+    submit = ({password, confirmPassword }) => {
+        const {actions:{changePasswordRequest},data:{_id},token } = this.props
+        console.log(_id, password, confirmPassword, token);
+
+        changePasswordRequest({
+            token,
+           _id,
+            password,
+            confirmPassword
+        })
+        
+    }
+
+    render() {
+        const { children, handleSubmit, actions:{ changePasswordRequest }, handlers: {  handleClicked }, data, token } = this.props;
+        const { submit}=this
+        console.log( data)
+        return (
+            <form onSubmit={handleSubmit(submit)} >
+                <Field name="password" type="password" placeholder="Password" component={formInput} />
+                <Field name="confirmPassword" type="password" placeholder="new Password" component={formInput} />
+
+                <button
+                    type="button" className="link link--btn right"  onClick={
+                        function() {
+                        handleClicked();
+                            handleSubmit(submit)();
+                        }    
+                    
+                    }>
+                    Change
+                </button>
+            </form >
+        )
+    }
+}
+
+export default reduxForm({
+    form: "changePasswordForm",
+})(ChangePasswordForm);

+ 77 - 47
src/components/user/ProfilePage/index.js

@@ -1,88 +1,117 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import { bindActionCreators } from 'redux'
- import ChangeLoginForm from './ChangeLoginForm/index';
+import ChangeLoginForm from './ChangeLoginForm/index';
+import ChangeEmailForm from './ChangeEmailForm/index';
+import ChangePasswordForm from './changePassword/index'
+import {changeLoginRequest} from '../../../actions/user/changelogin';
+import {changeEmailRequest} from '../../../actions/user/changeEmail';
+import {changePasswordRequest } from '../../../actions/user/changePassword'
 
-const user = {
-    "data": {
-        "_id": "5c48461c40ca670017ba5974",
-        "name": "Debil",
-        "email": "superus@lol.com",
-        "password": "$2a$10$qoxrQ2Sp3BDTLa9Xdc0ZPuLVHamipMQRWxeWxw1RwthICnbPoFLvC",
-        "profilePhoto": "",
-        "role": 0
-    },
-    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVjNDg0NjFjNDBjYTY3MDAxN2JhNTk3NCIsInJvbGUiOjAsImlhdCI6MTU0ODI1NTczMiwiZXhwIjoxNTQ4MzQyMTMyfQ.RAIiCLjBJ2u1VEQWy1oUgPjHj0dZRG27l0J3c8FDss0"
-}
 
 class ProfilePage extends React.Component {
+    
     state={
-        clicked:false
+        clicked:false,
+        klick: false,
+        click: false
     }
 
     handleClick = () => {
         this.setState((prevState) => ({ clicked: !prevState.clicked }));
     }
+    handleClicks = () => {
+        this.setState((prevState) => ({ klick: !prevState.klick }));
+    }
+    handleClicked = () => {
+        this.setState((prevState) => ({ click: !prevState.click }));
+    }
 
     render() {
-        const { users, userChangeRequest, passwordChangeRequest } = this.props;
-        const { data } = user;
-        const {clicked} =this.state;
+        const { signIn:{data, token}, changeLoginRequest, chageLoginReducer, changeEmailRequest, changeEmailReducer, changePasswordRequest} = this.props;
+      console.log(changeEmailReducer)
+        const {clicked, klick, click} =this.state;
+        const {handleClick, handleClicks, handleClicked} = this;
 
         return (
             <div className="page page--bottom-only profile-page">
-                <section className="border bg-autumn-foliage m-5 rounded d-flex">
+                <div className="border bg-autumn-foliage m-5 rounded d-flex">
+                    <div>
+                {/* <h5 className="p-2 font-po-bold flex-fill bd-highlight align-self-end">{data.name}</h5> */}
+                {/* <div className="d-flex"  >
+                <p className="p-2 flex-fill font-po-bold bd-highlight align-self-end">Email</p><p className="p-2 flex-fill font-po-bold bd-highlight align-self-end">{data.email}</p>
+                </div> */}
+                {/* <div className="d-flex"  >
+                <p className="p-2 flex-fill font-po-bold bd-highlight align-self-end">Role</p><p className="p-2 flex-fill font-po-bold bd-highlight align-self-end">{data.role}</p>
+                </div> */}
+                
                     <div>
                         <img className="m-4 " src=" https://cdn.iconscout.com/icon/free/png-256/avatar-373-456325.png" ></img>
                     </div>
+                    </div>
                     <div className="border-left bg-autumn-foliage m-5 rounded w-75 ">
                             {!clicked
                             ?
                         <div  className ="d-flex mb-3" >
                             <h3 className = " p-2 flex-fill bd-highlight">Name</h3>
-                            <h5 className="p-2 font-po-bold flex-fill bd-highlight align-self-end">{data.name}</h5>
-                            <button type="button" onClick ={this.handleClick} className=" flex-fill bg-shadow btn btn-outline-light col-3">Change</button>
+                            <h5 className="p-2 font-po-bold flex-fill bd-highlight align-self-end">{
+                                chageLoginReducer.data == null
+                                ?
+                                data.name 
+                                :
+                                chageLoginReducer.data
+
+                                }</h5>
+                            <button type="button" onClick ={handleClick}  className=" flex-fill bg-shadow btn btn-outline-primary col-3">Change</button>
                         </div>
                         :
                         <div>
                         <h3 className = " p-2 flex-fill bd-highlight">Name</h3>
                         <h5 className="p-2 font-po-bold flex-fill bd-highlight align-self-end">{data.name}</h5>
-                        <ChangeLoginForm> </ChangeLoginForm>
+                        <ChangeLoginForm data ={data} token={token} actions ={{changeLoginRequest}} handlers={{ handleClick}}> </ChangeLoginForm>
                         </div>
                             }
+                            {!klick
+                            ?
+                        <div  className ="d-flex mb-3" >
+                            <h3 className = "p-2 flex-fill bd-highlight">Email</h3>
+                            <h5 className="p-2 flex-fill font-po-bold bd-highlight align-self-end">
+                                {
+                                    changeEmailReducer.data ===null
+                                    ?
+                                    data.email
+                                    :
+                                    changeEmailReducer.data
+                                }
+                            </h5>
+                            <button type="button" name ="name"  onClick ={handleClicks} className=" flex-fill bg-shadow btn btn-outline-primary col-3">Change</button>
+                        </div>
+                        :
                         <div  className ="d-flex mb-3" >
                             <h3 className = "p-2 flex-fill bd-highlight">Email</h3>
                             <h5 className="p-2 flex-fill font-po-bold bd-highlight align-self-end">{data.email}</h5>
-                            <button type="button" className=" flex-fill bg-shadow btn btn-outline-light col-3">Change</button>
+                            <ChangeEmailForm  data ={data} token={token} actions ={{changeEmailRequest}} handlers={{ handleClicks}}></ChangeEmailForm>
                         </div>
+                            }
+                            {
+                                !click
+                                ?
                         <div  className ="d-flex mb-3" >
                             <h3 className = "p-2 flex-fill bd-highlight">Password</h3>
-                            <button type="button" className=" flex-fill bg-shadow btn btn-outline-light col-3">Change</button>
+                            <button type="button" onClick ={handleClicked} className=" flex-fill bg-shadow btn btn-outline-primary col-3">Change</button>
+                        </div>
+                        :
+                        <div  className ="d-flex mb-3" >
+                            <h3 className = "p-2 flex-fill bd-highlight">Password</h3>
+                           <ChangePasswordForm data ={data} token={token} actions ={{changePasswordRequest}} handlers={{ handleClicked}}></ChangePasswordForm>
                         </div>
-                 
-                    </div>
-                </section>
-                <section className="container section section--stats">
-                    <div className="section__element section__element--">
-                        <h3>Member Since</h3>
-                        <p>{new Date(data.createdAt).toLocaleString()}</p>
-                    </div>
-                    <div className="section__element section__element--comments border-right-0">
-                        <h3>Last comments</h3>
-                        <p className="comments-block">
-                            {
-                                data.comments && data.comments
-                                    .slice(0, 60)
-                                    .map(el =>
-                                        <p>
-                                            <h4>{new Date(el.createdAt).toLocaleString()}</h4>
-                                            {el.text}
-                                        </p>)
                             }
-                        </p>
+                 
                     </div>
-                </section>
-            </div>
+                </div>
+                
+                </div>
+            
         )
     }
 
@@ -90,10 +119,11 @@ class ProfilePage extends React.Component {
 
 const
     mapStateToProps = state => ({
-        user: state.user,
-        users: state.users
+        signIn: state.signIn,
+        chageLoginReducer: state.chageLoginReducer,
+        changeEmailReducer:state.changeEmailReducer
     });
 
-const mapDispatchToProps = dispatch => bindActionCreators({}, dispatch);
+const mapDispatchToProps = dispatch => bindActionCreators({changeLoginRequest, changeEmailRequest, changePasswordRequest}, dispatch);
 
 export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);

+ 2 - 2
src/configs/routerConfig.js

@@ -2,7 +2,7 @@ import React, { lazy } from 'react';
 import * as routes from './../constants/routes';
 
 const ProfilePage = lazy(() => import('../components/user/ProfilePage'))
-
+const DeleteUser = lazy(()=>import('../components/admin/deleteUser/index'))
 // import SignIn from '../components/public/SignIn';
 const SignIn = lazy(() => import('./../components/public/SignIn'));
 const SignUp = lazy(() => import('./../components/public/SignUp'));
@@ -46,7 +46,7 @@ export default [
     {
         path: routes.DELETE_USER,
         access: 'admin-only',
-        component: () => <div>delete user</div>
+        component: DeleteUser
     },
     {
         access: 'public',

+ 12 - 0
src/constants/user.js

@@ -0,0 +1,12 @@
+export const USER_URL = 'https://test-app-a-level.herokuapp.com/users/'; 
+export const CHANGE_LOGIN_REQUEST = 'CHANGE_LOGIN_REQUEST';
+export const CHANGE_LOGIN_REQUEST_SUCCESS = 'CHANGE_LOGIN_REQUEST_SUCCESS';
+export const CHANGE_LOGIN_REQUEST_FAILURE = 'CHANGE_LOGIN_REQUEST_FAILURE';
+
+export const CHANGE_EMAIL_REQUEST = 'CHANGE_EMAIL_REQUEST';
+export const CHANGE_EMAIL_REQUEST_SUCCESS = 'CHANGE_EMAIL_REQUEST_SUCCESS';
+export const CHANGE_EMAIL_REQUEST_FAILURE = 'CHANGE_EMAIL_REQUEST_FAILURE';
+
+export const CHANGE_PASSWORD_REQUEST = 'CHANGE_PASSWORD_REQUEST';
+export const CHANGE_PASSWORD_REQUEST_SUCCESS = 'CHANGE_PASSWORD_REQUEST_SUCCESS';
+export const CHANGE_PASSWORD_REQUEST_FAILURE = 'CHANGE_PASSWORD_REQUEST_FAILURE';

+ 6 - 0
src/reducers/index.js

@@ -4,8 +4,14 @@ import { reducer as form } from 'redux-form';
 import signIn from './auth/signIn';
 import signUp from './auth/signUp';
 
+import chageLoginReducer from './user/chageLogin';
+import changeEmailReducer from './user/changeEmail';
+
 export default combineReducers({
+
     signIn,
     signUp,
+    chageLoginReducer,
+    changeEmailReducer,
     form
 })

+ 11 - 1
src/reducers/initialState.js

@@ -9,5 +9,15 @@ export default {
         isFetching: false,
         isSuccessful: null,
         error: null
-    }
+    },
+    changeLogin:{
+        isFetching: false,
+        data: null,
+        error: null
+    },
+    changeEmail:{
+        isFetching: false,
+        data: null,
+        error: null
+    },
 }

+ 37 - 0
src/reducers/user/chageLogin.js

@@ -0,0 +1,37 @@
+import * as actionTypes from './../../constants/user';
+import initialState from './../initialState';
+
+export default function chageLoginReducer(state = initialState.changeLogin, {  type, payload }) {
+    switch (type) {
+        case actionTypes.CHANGE_LOGIN_REQUEST: {
+            console.log(payload)
+            return {
+                ...state,
+                isFetching: true,
+                payload
+            }
+        }
+        case actionTypes.CHANGE_LOGIN_REQUEST_SUCCESS: {
+            const { user:{name} } = payload;
+            console.log(name)
+
+            return {
+                ...state,
+                isFetching: false,
+                data:name
+            }
+        }
+        case actionTypes.CHANGE_LOGIN_REQUEST_FAILURE: {
+            const { error } = payload;
+
+            return {
+                ...state,
+                isFetching: false,
+                error
+            }
+        }
+        default: {
+            return state;
+        }
+    }
+}

+ 37 - 0
src/reducers/user/changeEmail.js

@@ -0,0 +1,37 @@
+import * as actionTypes from './../../constants/user';
+import initialState from './../initialState';
+
+export default function changeEmailReducer(state = initialState.changeEmail, {  type, payload }) {
+    switch (type) {
+        case actionTypes.CHANGE_EMAIL_REQUEST: {
+            console.log(payload)
+            return {
+                ...state,
+                isFetching: true,
+                payload
+            }
+        }
+        case actionTypes.CHANGE_EMAIL_REQUEST_SUCCESS: {
+            const { user:{email} } = payload;
+            console.log(email)
+
+            return {
+                ...state,
+                isFetching: false,
+                data:email
+            }
+        }
+        case actionTypes.CHANGE_EMAIL_REQUEST_FAILURE: {
+            const { error } = payload;
+
+            return {
+                ...state,
+                isFetching: false,
+                error
+            }
+        }
+        default: {
+            return state;
+        }
+    }
+}

+ 3 - 1
src/sagas/index.js

@@ -1,6 +1,8 @@
 import { fork } from "redux-saga/effects";
 import auth from './auth'
+import user from './user/index'
 
 export default function*() {
-    yield fork(auth)
+    yield fork(user);
+    yield fork(auth);
 }

+ 27 - 0
src/sagas/user/changeEmail.js

@@ -0,0 +1,27 @@
+import { put, call } from 'redux-saga/effects';
+import axios from 'axios';
+
+import { USER_URL } from './../../constants/user';
+import { changeEmailSuccess, changeEmailFailure } from './../../actions/user/changeEmail'
+
+export default function* ({payload:{_id,email,token}}) {
+    console.log('User inside the worker-saga', _id,email,token);
+    try {
+        const config = {
+            headers: {
+                "Content-Type": "application/json",
+                "Authorization": `Bearer ${token}`
+            }
+        }
+
+        const user = yield call(() =>
+            axios.put(`${USER_URL}${_id}`,{email:email}, config)
+                .then(({ data }) => data)
+        )
+
+        yield put(changeEmailSuccess(user));
+    }
+    catch ({ message }) {
+        yield put(changeEmailFailure(message));
+    }
+}

+ 27 - 0
src/sagas/user/changeLogin.js

@@ -0,0 +1,27 @@
+import { put, call } from 'redux-saga/effects';
+import axios from 'axios';
+
+import { USER_URL } from './../../constants/user';
+import { changeLoginSuccess, changeLoginFailure } from './../../actions/user/changelogin'
+
+export default function* ({payload:{_id,name,token}}) {
+    console.log('User inside the worker-saga', _id,name,token);
+    try {
+        const config = {
+            headers: {
+                "Content-Type": "application/json",
+                "Authorization": `Bearer ${token}`
+            }
+        }
+
+        const user = yield call(() =>
+            axios.put(`${USER_URL}${_id}`,{name:name}, config)
+                .then(({ data }) => data)
+        )
+
+        yield put(changeLoginSuccess(user));
+    }
+    catch ({ message }) {
+        yield put(changeLoginFailure(message));
+    }
+}

+ 28 - 0
src/sagas/user/changePassword.js

@@ -0,0 +1,28 @@
+import { put, call } from 'redux-saga/effects';
+import axios from 'axios';
+
+import { USER_URL } from './../../constants/user';
+import { changePasswordSuccess, changePasswordFailure } from './../../actions/user/changePassword'
+
+export default function* ({payload:{_id, password, confirmPassword,token}}) {
+    console.log('User inside the worker-saga', _id, password, confirmPassword, token);
+    try {
+        const config = {
+            headers: {
+                "Content-Type": "application/json",
+                "Authorization": `Bearer ${token}`
+            }
+        }
+
+        const user = yield call(() =>
+            axios.put(`${USER_URL}${_id}`,{
+                password, confirmPassword}, config)
+                .then(({ data }) => data)
+        )
+
+        yield put(changePasswordSuccess(user));
+    }
+    catch ({ message }) {
+        yield put(changePasswordFailure(message));
+    }
+}

+ 15 - 0
src/sagas/user/index.js

@@ -0,0 +1,15 @@
+import changeLogin from './changeLogin';
+import changeEmail from './changeEmail';
+import changePassword from './changePassword'
+import * as actionTypes from './../../constants/user'
+
+import { takeEvery } from 'redux-saga/effects';
+
+export default function* () {
+    yield takeEvery(actionTypes.CHANGE_LOGIN_REQUEST, changeLogin);
+    yield takeEvery(actionTypes.CHANGE_EMAIL_REQUEST, changeEmail);
+    yield takeEvery(actionTypes.CHANGE_PASSWORD_REQUEST, changePassword);
+
+
+
+}