12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /* Actions*/
- import { INIT_COMPANY_USER } from '@/constants/actionTypes'
- /* Mutations*/
- import { SET_COMPANY_USER, SET_CURRENCY_COMPANY } from '@/constants/mutationTypes'
- const initialState = {
- company: [],
- currencyCompany: []
- }
- const state = {
- company: initialState.company,
- currencyCompany: initialState.currencyCompany
- }
- const getters = {
- /**
- * [company description]
- * @param {[type]} state [description]
- * @return {[type]} [description]
- */
- company ( state ) {
- return state.company
- },
- /**
- * [currencyCompany description]
- * @param {[type]} state [description]
- * @return {[type]} [description]
- */
- currencyCompany ( state ) {
- return state.currencyCompany
- }
- }
- const mutations = {
- /**
- * [company description]
- * @type {[type]}
- */
- [SET_COMPANY_USER] ( state, payload ){
- state.company = payload
- },
- /**
- * [currencyCompany description]
- * @type {[type]}
- */
- [SET_CURRENCY_COMPANY] (state, payload ) {
- state.currencyCompany = payload
- }
- }
- const actions = {
- /**
- * [INIT_COMPANY_USER]
- */
- [INIT_COMPANY_USER] ({ commit }, payload ) {
- commit(SET_COMPANY_USER, payload.company)
- commit(SET_CURRENCY_COMPANY, payload.currency)
- }
- }
- export default {
- state,
- getters,
- mutations,
- actions
- }
|