Allow deleting views 2
This commit is contained in:
parent
16764e6634
commit
1e9ce06504
|
@ -26,7 +26,11 @@ export function createViewsStore() {
|
|||
}
|
||||
|
||||
const deleteView = async view => {
|
||||
await API.deleteView(view.name)
|
||||
if (view.version === 2) {
|
||||
await API.viewV2.delete(view._id)
|
||||
} else {
|
||||
await API.deleteView(view.name)
|
||||
}
|
||||
|
||||
// Update tables
|
||||
tables.update(state => {
|
||||
|
|
|
@ -13,4 +13,11 @@ export const buildViewV2Endpoints = API => ({
|
|||
fetch: async id => {
|
||||
return await API.get({ url: `/api/v2/views/${id}/search` })
|
||||
},
|
||||
/**
|
||||
* Delete a view
|
||||
* @param id the id of the view to delete
|
||||
*/
|
||||
delete: async id => {
|
||||
return await API.delete({ url: `/api/v2/views/${id}` })
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue