fix: clear empty indexes and foreign keys on confirm respective modals

This commit is contained in:
Fabio Di Stasio 2021-07-17 09:59:45 +02:00
parent 5c855a520a
commit 04fa320820
2 changed files with 9 additions and 0 deletions

View File

@ -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) {
@ -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,

View File

@ -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) {