email removed from update mutation.

This commit is contained in:
Luis Fernando Molina committed 2018-09-11 11:18:22 +02:00
1 parent b07156e231
commit 0db2fe5a9d
3 files changed
+11 -21

No files matched your search

+10 -3
View File
@@ -47,8 +47,6 @@ class UserUpdate extends Component {
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,
@@ -138,9 +136,18 @@ console.log("component will UNmount");
let user = JSON.parse(localStorage.getItem("loggedInUser"));
console.log("user", user);
this.defaultValuesSet= true;
/* Now we can set the default values for the form fields. */
this.refs.firstName.value = user.firstName;
this.refs.middleName.value = user.middleName;
this.refs.email.value = user.email;
this.refs.emailVerified.checked = user.emailVerified;
this.setState({id: user.id});
this.setState({
id: user.id,
firstName: user.firstName,
middleName: user.middleName
});
console.log("setting defaults");
}
}
+1 -14
View File
@@ -60,23 +60,12 @@ const getRolesQuery = gql`
}
`
const addUserMutation = gql`
mutation($alias: String!, $authId:String!) {
addUser (alias: $alias, authId: $authId){
id
authId
}
}
`
const updateUserMutation = gql`
mutation(
$id: ID!,
$firstName:String,
$middleName:String,
$lastName:String,
$email:String,
$emailVerified:Int,
$isDeveloper:Int,
$isTrader:Int,
$isDataAnalyst:Int,
@@ -88,8 +77,6 @@ mutation(
firstName:$firstName,
middleName: $middleName,
lastName: $lastName,
email: $email,
emailVerified: $emailVerified,
isDeveloper: $isDeveloper,
isTrader: $isTrader,
isDataAnalyst: $isDataAnalyst,
@@ -101,4 +88,4 @@ mutation(
}
}
`
export {getUsersQuery, getUserByAuthIdQuery, getRolesQuery, addUserMutation, updateUserMutation, getUserProfileQuery}
export {getUsersQuery, getUserByAuthIdQuery, getRolesQuery, updateUserMutation, getUserProfileQuery}
-4
View File
@@ -178,8 +178,6 @@ const Mutation = new GraphQLObjectType({
firstName: {type: GraphQLString},
middleName: {type: GraphQLString},
lastName: {type: GraphQLString},
email: {type: GraphQLString},
emailVerified: {type: GraphQLInt},
isDeveloper: {type: GraphQLInt},
isTrader: {type: GraphQLInt},
isDataAnalyst: {type: GraphQLInt},
@@ -195,8 +193,6 @@ const Mutation = new GraphQLObjectType({
firstName: args.firstName,
middleName: args.middleName,
lastName: args.lastName,
email: args.email,
emailVerified: args.emailVerified,
isDeveloper: args.isDeveloper,
isTrader: args.isTrader,
isDataAnalyst: args.isDataAnalyst,