diff --git a/client/src/components/UpdateUser.js b/client/src/components/UpdateUser.js index c878095a9..c8f430738 100644 --- a/client/src/components/UpdateUser.js +++ b/client/src/components/UpdateUser.js @@ -10,14 +10,17 @@ class UpdateUser extends Component { this.state = { id: '5b90fc33ae71ee3798b2317d', // TODO this Id is the one that should be available to all components after the validation that the user is authenticated. firstName: '', + middleName: '', lastName: '', + email: '', + emailVerified: 0, isDeveloper: 0, isTrader: 0, isDataAnalyst: 0, roleId: '1' }; } - + displayRoles(){ var data = this.props.getRolesQuery; // When there is more than one query binded to a single componente 'data' is replaced by thename of the query given below at the binding operation. if(data.loading){ @@ -36,7 +39,10 @@ class UpdateUser extends Component { variables: { id: this.state.id, firstName: this.state.firstName, + middleName: this.state.middleName, lastName: this.state.lastName, + email: this.state.email, + emailVerified: this.state.emailVerified, isDeveloper: this.state.isDeveloper, isTrader: this.state.isTrader, isDataAnalyst: this.state.isDataAnalyst, @@ -119,12 +125,30 @@ class UpdateUser extends Component { +
+
+ this.setState({ middleName:e.target.value})}/> + +
+
this.setState({ lastName:e.target.value})}/>
+
+
+ this.setState({ email:e.target.value})}/> + +
+
+
+
+ + +
+
diff --git a/client/src/queries/queries.js b/client/src/queries/queries.js index f0b282b41..45b2c38ce 100644 --- a/client/src/queries/queries.js +++ b/client/src/queries/queries.js @@ -68,8 +68,32 @@ mutation($alias: String!, $authId:String!) { ` const updateUserMutation = gql` -mutation($id: ID!, $firstName:String, $middleName:String, $lastName:String, $email:String, $emailVerified:Int, $isDeveloper:Int, $isTrader:Int, $isDataAnalyst:Int, $roleId:String!) { - updateUser (id: $id, firstName:$firstName, middleName: $middleName, lastName: $lastName, email: $email, emailVerified: $emailVerified, isDeveloper: $isDeveloper, isTrader: $isTrader, isDataAnalyst: $isDataAnalyst, roleId: $roleId){ +mutation( + $id: ID!, + $firstName:String, + $middleName:String, + $lastName:String, + $email:String, + $emailVerified:Int, + $isDeveloper:Int, + $isTrader:Int, + $isDataAnalyst:Int, + $roleId:String! +) + { + updateUser ( + id: $id, + firstName:$firstName, + middleName: $middleName, + lastName: $lastName, + email: $email, + emailVerified: $emailVerified, + isDeveloper: $isDeveloper, + isTrader: $isTrader, + isDataAnalyst: $isDataAnalyst, + roleId: $roleId + ) + { id alias }