feat: port base store to pinia
This commit is contained in:
@ -54,11 +54,9 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, shallowRef, computed, watch, unref } from 'vue'
|
||||
import {useRouter, useRoute} from 'vue-router'
|
||||
import {useStore} from '@/store'
|
||||
import {success} from '@/message'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import type {MaybeRef} from '@vueuse/core'
|
||||
import {CURRENT_LIST} from '@/store/mutation-types'
|
||||
|
||||
import {default as Editor} from '@/components/input/AsyncEditor'
|
||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||
@ -70,9 +68,12 @@ import SavedFilterService from '@/services/savedFilter'
|
||||
import {objectToSnakeCase} from '@/helpers/case'
|
||||
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
||||
import type {IList} from '@/modelTypes/IList'
|
||||
|
||||
import {useBaseStore} from '@/stores/base'
|
||||
import {useNamespaceStore} from '@/stores/namespaces'
|
||||
|
||||
const {t} = useI18n({useScope: 'global'})
|
||||
const baseStore = useBaseStore()
|
||||
const namespaceStore = useNamespaceStore()
|
||||
|
||||
function useSavedFilter(listId: MaybeRef<IList['id']>) {
|
||||
@ -115,7 +116,6 @@ function useSavedFilter(listId: MaybeRef<IList['id']>) {
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
const store = useStore()
|
||||
const listId = computed(() => Number(route.params.listId as string))
|
||||
|
||||
const {
|
||||
@ -129,7 +129,7 @@ const router = useRouter()
|
||||
|
||||
async function saveSavedFilter() {
|
||||
await save()
|
||||
await store.dispatch(CURRENT_LIST, {list: filter})
|
||||
await baseStore.setCurrentList({list: filter})
|
||||
router.back()
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user