feat: simplify namespace search (#1835)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1835 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:

committed by
konrad

parent
ddc1cff7ea
commit
8578225982
19
src/composables/useNamespaceSearch.ts
Normal file
19
src/composables/useNamespaceSearch.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import {ref, computed, Ref} from 'vue'
|
||||
import {useStore} from 'vuex'
|
||||
|
||||
export function useNameSpaceSearch() {
|
||||
const query = ref('')
|
||||
|
||||
const store = useStore()
|
||||
const namespaces = computed(() => store.getters['namespaces/searchNamespace'](query.value))
|
||||
|
||||
function findNamespaces(newQuery: string) {
|
||||
query.value = newQuery
|
||||
}
|
||||
|
||||
return {
|
||||
namespaces,
|
||||
findNamespaces,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user