feat: move list store to pina (#2392)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2392
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
Dominik Pschenitschni 2022-09-21 16:21:25 +00:00 committed by konrad
parent f85a08afb4
commit a38075f376
23 changed files with 272 additions and 239 deletions

View file

@ -35,6 +35,7 @@ import type {INamespace} from '@/modelTypes/INamespace'
import {success} from '@/message'
import {useTitle} from '@/composables/useTitle'
import {useNameSpaceSearch} from '@/composables/useNamespaceSearch'
import {useListStore} from '@/stores/lists'
const {t} = useI18n({useScope: 'global'})
useTitle(() => t('list.duplicate.title'))
@ -53,6 +54,7 @@ function selectNamespace(namespace: INamespace) {
const route = useRoute()
const router = useRouter()
const store = useStore()
const listStore = useListStore()
const listDuplicateService = shallowReactive(new ListDuplicateService())
@ -66,7 +68,7 @@ async function duplicateList() {
const duplicate = await listDuplicateService.create(listDuplicate)
store.commit('namespaces/addListToNamespace', duplicate.list)
store.commit('lists/setList', duplicate.list)
listStore.setList(duplicate.list)
success({message: t('list.duplicate.success')})
router.push({name: 'list.index', params: {listId: duplicate.list.id}})
}