mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: unable to rename views
This commit is contained in:
@ -225,7 +225,8 @@ export default {
|
||||
...mapActions({
|
||||
addNotification: 'notifications/addNotification',
|
||||
refreshStructure: 'workspaces/refreshStructure',
|
||||
setUnsavedChanges: 'workspaces/setUnsavedChanges'
|
||||
setUnsavedChanges: 'workspaces/setUnsavedChanges',
|
||||
changeBreadcrumbs: 'workspaces/changeBreadcrumbs'
|
||||
}),
|
||||
async getViewData () {
|
||||
if (!this.view) return;
|
||||
@ -260,14 +261,25 @@ export default {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
view: this.localView
|
||||
view: {
|
||||
...this.localView,
|
||||
oldName: this.originalView.name
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
const { status, response } = await Views.alterView(params);
|
||||
|
||||
if (status === 'success') {
|
||||
const oldName = this.originalView.name;
|
||||
|
||||
await this.refreshStructure(this.connection.uid);
|
||||
|
||||
if (oldName !== this.localView.name) {
|
||||
this.setUnsavedChanges(false);
|
||||
this.changeBreadcrumbs({ schema: this.schema, view: this.localView.name });
|
||||
}
|
||||
|
||||
this.getViewData();
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user