fix: get views from store based on view type

This commit is contained in:
Shariq Ansari 2024-06-01 14:00:45 +05:30
parent 89b2ce606b
commit 08a72b1f31

View File

@ -34,9 +34,13 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
},
})
function getView(view, doctype = null) {
function getView(view, type, doctype = null) {
if (!view && doctype) {
return defaultView.value?.[doctype] || null
let _view = defaultView.value[doctype] || null
if (_view && _view['type'] !== type) {
_view = null
}
return _view
}
return viewsByName[view]
}