Csy817 7 жил өмнө
parent
commit
7726904839

+ 6 - 3
src/app/graphqlService/component/schema/Schema.jsx

@@ -138,6 +138,7 @@ class Schema extends Component {
             currentTable: next.location.state === undefined ? '' : next.location.state.create ? 'add' : '',
             schemaID: next.schemaID,
             schemaName: next.schemaName,
+            projectID:next.projectID,
             data: '',
             once: 0
         });
@@ -188,6 +189,7 @@ class Schema extends Component {
                                             {
                                                 this.state.editSchemaName ?
                                                     <ModifySchemaNameInput
+                                                        projectID={this.state.projectID}
                                                         editSchemaName={this.state.editSchemaName}
                                                         changeEditSchemaName={this.changeEditSchemaName}
                                                         clearEditSchemaName={this.clearEditSchemaName}
@@ -726,7 +728,7 @@ class ModifySchemaNameInput extends Component {
     render() {
         let userID = this.props.userID;
         let schemaName = this.props.schemaName;
-        console.log('schemaId',this.props.schemaID);
+
         return (
             <Mutation mutation={gql(UPDATE_SCHEMA_PROJECT_NAME)}>
                 {(update_schema_project_name, {loading, error}) => {
@@ -747,12 +749,13 @@ class ModifySchemaNameInput extends Component {
                                         onSearch={value => {
                                             update_schema_project_name({
                                                 variables: {
-                                                    id: this.props.schemaID,
+                                                    schemaID: this.props.schemaID,
+                                                    projectID:this.props.projectID,
                                                     schemaName: value,
                                                     updateAt: new Date().getTime()
                                                 }
                                             }).then((res)=>{
-                                                console.log('update_schema_project_name res',res)
+                                                // console.log('update_schema_project_name res',res)
                                             });
                                             this.props.history.push({
                                                 pathname: `/graphql-service/my-create/${value}`,

+ 3 - 3
src/gql.js

@@ -190,9 +190,9 @@ const UPDATE_SCHEMA = `
         `;
 
 const UPDATE_SCHEMA_PROJECT_NAME = `
-            mutation UPDATE_SCHEMA_PROJECT_NAME($id: ID!, $schemaName: String, $updatedAt: String) {
+            mutation UPDATE_SCHEMA_PROJECT_NAME($schemaID: ID!, $projectID: ID, $schemaName: String, $updatedAt: String) {
                 update_schema(
-                    id: $id,
+                    id: $schemaID,
                     updatedAt: $updatedAt,
                     schemaName: $schemaName,
                 ) {
@@ -202,7 +202,7 @@ const UPDATE_SCHEMA_PROJECT_NAME = `
                 }
                 
                 update_project(
-                    schema_id: $id,
+                    id: $projectID,
                     updatedAt: $updatedAt,
                     projectName: $schemaName,
                 ){