Skip to content

Commit c58b11a

Browse files
committed
final clean up, edited readme, removed old code
1 parent 9d4fdd3 commit c58b11a

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

src/components/ReactFlow/DataTableNode.tsx

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ export default function DataTableNode({ data} : {data:Data} ) { //this 'data' i
115115

116116

117117
const deleteRow = async (value:RowsOfData,index:number,id:number|string):Promise<void> => {
118-
119-
120118
////////////////////////// CHECK TO SEE IF IT HAS A REFERENCE FOREIGN KEY BEFORE DELETE/////////////
121119
//loop through all of deleteRow values and check if there is a corresponding referenceStore, if so throw error because it has a corresponding foreign key.
122120
// for(let col in value){
@@ -129,12 +127,9 @@ export default function DataTableNode({ data} : {data:Data} ) { //this 'data' i
129127
// }
130128
// }
131129
// }
132-
/////////////////////////////////////////////////////////////////////////
133-
130+
////////////////////////////////////////////////////////////////////////
134131
const newDatastore = structuredClone(dataStore);
135-
136132
restRowsData = restRowsData.slice(0,index).concat(restRowsData.slice(index+1,restRowsData.length));
137-
138133
newDatastore[tableName] = restRowsData;
139134
setDataStore({...newDatastore,[id]:restRowsData});
140135
await fetch(`/api/sql/${dbCredentials.db_type}/deleteRow`, {
@@ -149,28 +144,7 @@ const newDatastore = structuredClone(dataStore);
149144
return res;
150145
})
151146
.catch((err: ErrorEvent) => { console.error('deleting row error', err) })
152-
} else {
153-
const sendDeleteRequest = fetch(`/api/sql/${dbCredentials.db_type}/deleteRow`, {
154-
method: 'DELETE',
155-
headers: {
156-
'Content-Type': 'application/json'
157-
},
158-
body: JSON.stringify({ tableName: tableName, deletedRow: value })
159-
})
160-
.then((res) => {
161-
//console.log("deleting row info sent")
162-
return res;
163-
})
164-
.catch((err: ErrorEvent) => { console.error('deleting row error', err) })
165-
}
166-
////////////////// Fetch path: /api/delete ///////////////////
167-
// {
168-
// tableName: name of table,
169-
// primaryKey: primary key,
170-
// value: corresponding value of the primary key
171-
// }
172-
////////////////////////////////////////////
173-
}
147+
};
174148

175149

176150

src/components/ReactFlow/TableNodeColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function TableNodeColumn({
7474
'Content-Type':'application/json'
7575
},
7676
body:JSON.stringify({tableName: tableRef.substring(tableRef.indexOf('.') + 1), columnName: colRef})
77-
})
77+
});
7878
deleteColumnSchema(tableRef, colRef);
7979
};
8080

0 commit comments

Comments
 (0)