|
@@ -112,6 +112,7 @@ class Schema extends Component {
|
|
|
schemaID={this.state.schemaID}
|
|
schemaID={this.state.schemaID}
|
|
|
userID={userID}
|
|
userID={userID}
|
|
|
schemaName={this.state.schemaName}
|
|
schemaName={this.state.schemaName}
|
|
|
|
|
+ history={this.props.history}
|
|
|
/>
|
|
/>
|
|
|
:
|
|
:
|
|
|
<div className={'schema'}>
|
|
<div className={'schema'}>
|
|
@@ -458,21 +459,7 @@ class ModifySchemaNameInput extends Component {
|
|
|
let userID = this.props.userID;
|
|
let userID = this.props.userID;
|
|
|
let schemaName = this.props.schemaName;
|
|
let schemaName = this.props.schemaName;
|
|
|
return (
|
|
return (
|
|
|
- <Mutation
|
|
|
|
|
- mutation={gql(UPDATE_SCHEMA_NAME)}
|
|
|
|
|
- update={(cache) => {
|
|
|
|
|
- let data = cache.readQuery({query: gql(SHOW_ALL_SCHEMA), variables: {user_id: userID}});
|
|
|
|
|
- console.log('a', data);
|
|
|
|
|
- console.log('b', schemaName);
|
|
|
|
|
- console.log(data.schema_by_props.findIndex(obj => obj.schemaName === schemaName));
|
|
|
|
|
- // data.schema_by_props[data.schema_by_props.findIndex(obj => obj.schemaName === schemaName)]= '';
|
|
|
|
|
- // cache.writeQuery({
|
|
|
|
|
- // query: gql(SHOW_SCHEMA),
|
|
|
|
|
- // variables: {user_id: userID},
|
|
|
|
|
- // data
|
|
|
|
|
- // });
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <Mutation mutation={gql(UPDATE_SCHEMA_NAME)}>
|
|
|
{(update_schema, {loading, error}) => {
|
|
{(update_schema, {loading, error}) => {
|
|
|
if (error)
|
|
if (error)
|
|
|
return 'error';
|
|
return 'error';
|
|
@@ -494,6 +481,13 @@ class ModifySchemaNameInput extends Component {
|
|
|
updateAt: new Date().getTime()
|
|
updateAt: new Date().getTime()
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ this.props.history.push({
|
|
|
|
|
+ pathname: `/graphql-service/my-create/${value}`,
|
|
|
|
|
+ state:{
|
|
|
|
|
+ schemaName:value,
|
|
|
|
|
+ schemaID:this.props.schemaID,
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
this.props.clearEditSchemaName();
|
|
this.props.clearEditSchemaName();
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|