build version 400

This commit is contained in:
Mohit Panjwani
2020-12-02 17:54:08 +05:30
parent 326508e567
commit 89ee58590c
963 changed files with 62887 additions and 48868 deletions

View File

@ -0,0 +1,16 @@
import * as types from './mutation-types'
export const searchUsers = ({ commit, dispatch, state }, params) => {
return new Promise((resolve, reject) => {
window.axios
.get(`/api/v1/search`, { params })
.then((response) => {
commit(types.SET_CUSTOMER_LISTS, response.data.customers.data)
commit(types.SET_USER_LISTS, response.data.users.data)
resolve(response)
})
.catch((err) => {
reject(err)
})
})
}

View File

@ -0,0 +1,4 @@
export const getCustomerList = (state) =>
state.customerList ? state.customerList : []
export const getUserList = (state) => (state.userList ? state.userList : [])

View File

@ -0,0 +1,20 @@
import mutations from './mutations'
import * as actions from './actions'
import * as getters from './getters'
const initialState = {
userList: [],
customerList: [],
}
export default {
namespaced: true,
state: initialState,
getters: getters,
actions: actions,
mutations: mutations,
}

View File

@ -0,0 +1,2 @@
export const SET_CUSTOMER_LISTS = 'SET_CUSTOMER_LISTS'
export const SET_USER_LISTS = 'SET_USER_LISTS'

View File

@ -0,0 +1,11 @@
import * as types from './mutation-types'
export default {
[types.SET_CUSTOMER_LISTS](state, customerList) {
state.customerList = customerList
},
[types.SET_USER_LISTS](state, userList) {
state.userList = userList
},
}