diff --git a/store/appbar.ts b/store/appbar.ts index 0f32913ce2286d574c90485b11317ea89fb60bd8..9bc9cccfc600c547bd143a24cf5d33ca8fb78e63 100644 --- a/store/appbar.ts +++ b/store/appbar.ts @@ -47,7 +47,7 @@ export interface IAppbarStore { * * @return {IAppbarStore} the state object */ -export const state = (): IAppbarStore => { +const state = (): IAppbarStore => { return { activeTab: null, cancelBtnDisabled: false, @@ -59,7 +59,7 @@ export const state = (): IAppbarStore => { } } -export const mutations = { +const mutations = { /** * Sets the title of the AppBar * @@ -141,7 +141,7 @@ type StoreContext = { dispatch: (action: string, payload: any) => void } -export const actions = { +const actions = { /** * initializes the Appbar * @@ -452,3 +452,10 @@ export const actions = { context.dispatch('init', state()) } } + +export default { + namespaced: true, + state, + actions, + mutations +} diff --git a/store/contacts.ts b/store/contacts.ts index 697771653c24770187c2c677d561b0dc81d9b71c..0562c563e4a4511fd2914898047139ec26347f09 100644 --- a/store/contacts.ts +++ b/store/contacts.ts @@ -46,7 +46,7 @@ interface contactsState { totalPages: number } -export const state = () => ({ +const state = () => ({ contacts: [], contact: null, configurationContacts: [], @@ -54,7 +54,8 @@ export const state = () => ({ pageNumber: 1, pageSize: 20 }) -export const getters = { + +const getters = { searchContacts: (state: contactsState) => { return state.contacts.filter((c: Contact) => !state.configurationContacts.find((rc: Contact) => rc.id === c.id)) }, @@ -68,7 +69,7 @@ export const getters = { } // @ts-ignore -export const actions: { +const actions: { [key: string]: any; $api: Api } = { @@ -126,7 +127,8 @@ export const actions: { return this.$api.contacts.save(contact) } } -export const mutations = { + +const mutations = { setContacts (state: contactsState, contacts: Contact[]) { state.contacts = contacts }, @@ -143,3 +145,11 @@ export const mutations = { state.totalPages = count } } + +export default { + namespaced: true, + state, + getters, + actions, + mutations +} diff --git a/store/files.ts b/store/files.ts index 02e759d710fc2756fd76bc2e212e332f7c0d3baa..1b109dd912849d0e7f0d9613a20cbe899e0df45c 100644 --- a/store/files.ts +++ b/store/files.ts @@ -33,6 +33,7 @@ import { Commit } from 'vuex' import { IUploadResult } from '@/services/sms/UploadApi' import { Api } from '@/services/Api' + const state = () => ({}) const getters = {} diff --git a/store/snackbar.ts b/store/snackbar.ts index 92abc39b0fe6e74b22f5ce5ff966536f9ceae5a3..0a2ad298effa7d644a6560357618922d5e8edfa2 100644 --- a/store/snackbar.ts +++ b/store/snackbar.ts @@ -34,14 +34,14 @@ export interface ISnackbarStore { success: string } -export const state = () => { +const state = () => { return { error: '', success: '' } } -export const mutations = { +const mutations = { setError (state: ISnackbarStore, error: string) { state.error = error }, @@ -55,3 +55,9 @@ export const mutations = { state.success = '' } } + +export default { + namespaced: true, + state, + mutations +}