Skip to content

Commit

Permalink
fix: clear empty indexes and foreign keys on confirm respective modals
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Jul 17, 2021
1 parent 5c855a5 commit 04fa320
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/renderer/components/WorkspacePropsForeignModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ export default {
addNotification: 'notifications/addNotification'
}),
confirmForeignsChange () {
this.foreignProxy = this.foreignProxy.filter(foreign =>
foreign.field &&
foreign.refField &&
foreign.table &&
foreign.refTable
);
this.$emit('foreigns-update', this.foreignProxy);
},
selectForeign (event, id) {
Expand Down Expand Up @@ -331,6 +337,8 @@ export default {
this.selectedForeignID = this.foreignProxy.length ? this.foreignProxy[0]._id : '';
},
async getRefFields () {
if (!this.selectedForeignObj.refTable) return;
const params = {
uid: this.connection.uid,
schema: this.selectedForeignObj.refSchema,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/WorkspacePropsIndexesModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default {
},
methods: {
confirmIndexesChange () {
this.indexesProxy = this.indexesProxy.filter(index => index.fields.length);
this.$emit('indexes-update', this.indexesProxy);
},
selectIndex (event, id) {
Expand Down

0 comments on commit 04fa320

Please sign in to comment.