Remove view on deletion
This commit is contained in:
parent
ca0d8e2eb6
commit
5fd004b86e
|
@ -35,9 +35,8 @@
|
|||
try {
|
||||
const isSelected =
|
||||
decodeURIComponent($params.viewName) === $views.selectedViewName
|
||||
const name = view.name
|
||||
const id = view.tableId
|
||||
await views.delete(name)
|
||||
await views.delete(view)
|
||||
notifications.success("View deleted")
|
||||
if (isSelected) {
|
||||
$goto(`./table/${id}`)
|
||||
|
|
|
@ -26,14 +26,12 @@ export function createViewsStore() {
|
|||
}
|
||||
|
||||
const deleteView = async view => {
|
||||
await API.deleteView(view)
|
||||
await API.deleteView(view.name)
|
||||
|
||||
// Update tables
|
||||
tables.update(state => {
|
||||
const table = state.list.find(table => table._id === view.tableId)
|
||||
if (table) {
|
||||
delete table.views[view.name]
|
||||
}
|
||||
delete table.views[view.name]
|
||||
return { ...state }
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue