Browse Source

fix: handle table new creation bug

re #795

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/797/head
Pranav C 3 years ago
parent
commit
ce612348a9
  1. 6
      packages/nc-gui/components/ProjectTreeView.vue
  2. 4
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

6
packages/nc-gui/components/ProjectTreeView.vue

@ -1310,8 +1310,8 @@ export default {
}); });
this.dialogRenameTable.dialogShow = false; this.dialogRenameTable.dialogShow = false;
this.dialogRenameTable.defaultValue = null; this.dialogRenameTable.defaultValue = null;
this.$toast.success('Table renamed succesfully').goAway(3000); this.$toast.success('Table renamed successfully').goAway(3000);
console.log(tn, cookie); console.log(_tn, cookie);
}, },
mtdDialogRenameTableCancel() { mtdDialogRenameTableCancel() {
console.log('mtdDialogGetTableNameCancel cancelled'); console.log('mtdDialogGetTableNameCancel cancelled');
@ -1319,7 +1319,7 @@ export default {
this.dialogRenameTable.defaultValue = null; this.dialogRenameTable.defaultValue = null;
}, },
mtdTableCreate(table) { mtdTableCreate(table) {
if (!this.menuItem) { if (!this.menuItem || this.menuItem.type !== 'tableDir') {
this.menuItem = this.listViewArr.find(n => n.type === 'tableDir'); this.menuItem = this.listViewArr.find(n => n.type === 'tableDir');
} }
// const tables = table.name.split(','); // const tables = table.name.split(',');

4
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -637,6 +637,10 @@ export default abstract class BaseApiBuilder<T extends Noco>
title: relTableName title: relTableName
} }
); );
XcCache.del(
[this.projectId, this.dbAlias, 'table', relTableName].join('::')
);
} }
return { meta, relatedTableList, tableName }; return { meta, relatedTableList, tableName };

Loading…
Cancel
Save