Skip to content

Commit 073b9c3

Browse files
Varun-Choudharyvijayprasanna13
authored andcommitted
console: fixed an issue where db to db relationship where not removed from the list after deletion [CON-64]
PR-URL: hasura/graphql-engine-mono#3928 Co-authored-by: Vijay Prasanna <[email protected]> GitOrigin-RevId: 6d3e1af3df9928bccc98036dfa0252110a4a11a9
1 parent 773b580 commit 073b9c3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

console/src/components/Services/Data/TableRelationships/Actions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ export const addDbToDbRelationship = (
696696
}
697697
};
698698

699-
export const dropDbToDbRelationship = (state, tableSchema, toggleEditor) => (
699+
export const dropDbToDbRelationship = (state, tableSchema, onSuccess) => (
700700
dispatch,
701701
getState
702702
) => {
@@ -754,7 +754,7 @@ export const dropDbToDbRelationship = (state, tableSchema, toggleEditor) => (
754754
const errorMsg = 'Deleting remote relationship failed';
755755

756756
const customOnSuccess = () => {
757-
toggleEditor();
757+
onSuccess();
758758
};
759759
const customOnError = () => {};
760760

console/src/components/Services/Data/TableRelationships/RemoteDbRelationships/AddManualRelationship.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ const AddManualRelationship = ({
4747
};
4848

4949
const removeFunc = relationship
50-
? (toggleEditor: unknown) => {
51-
reduxDispatch(dropDbToDbRelationship(state, tableSchema, toggleEditor));
50+
? (toggleEditor: () => void) => {
51+
reduxDispatch(
52+
dropDbToDbRelationship(state, tableSchema, () => {
53+
toggleEditor();
54+
queryClient.refetchQueries(['metadata'], { active: true });
55+
})
56+
);
5257
}
5358
: null;
5459

0 commit comments

Comments
 (0)