Merge pull request #11211 from Budibase/BUDI-7189/refresh-on-delete
Remove view on deletion
This commit is contained in:
commit
fa0a296012
2 changed files with 3 additions and 6 deletions
|
@ -35,9 +35,8 @@
|
||||||
try {
|
try {
|
||||||
const isSelected =
|
const isSelected =
|
||||||
decodeURIComponent($params.viewName) === $views.selectedViewName
|
decodeURIComponent($params.viewName) === $views.selectedViewName
|
||||||
const name = view.name
|
|
||||||
const id = view.tableId
|
const id = view.tableId
|
||||||
await views.delete(name)
|
await views.delete(view)
|
||||||
notifications.success("View deleted")
|
notifications.success("View deleted")
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
$goto(`./table/${id}`)
|
$goto(`./table/${id}`)
|
||||||
|
|
|
@ -26,14 +26,12 @@ export function createViewsStore() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteView = async view => {
|
const deleteView = async view => {
|
||||||
await API.deleteView(view)
|
await API.deleteView(view.name)
|
||||||
|
|
||||||
// Update tables
|
// Update tables
|
||||||
tables.update(state => {
|
tables.update(state => {
|
||||||
const table = state.list.find(table => table._id === view.tableId)
|
const table = state.list.find(table => table._id === view.tableId)
|
||||||
if (table) {
|
delete table.views[view.name]
|
||||||
delete table.views[view.name]
|
|
||||||
}
|
|
||||||
return { ...state }
|
return { ...state }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue