import * as T from '@/store/utils/types'

export default {
  [T.SET_BUNDLE_LIST](state, data) {
    state.bundleList = data
  },
  [T.SET_BUNDLE_LIST_RECORD_TOTAL](state, data) {
    state.bundleListRecordTotal = data
  },
  [T.SET_BUNDLE_DETAILS_DATA](state, data) {
    state.bundleDetails = data
  },
  [T.SET_BUNDLE_COUNTRY](state, data) {
    state.bundleCountryId = data
  },
  [T.SET_BUNDLE_PRODUCTS_FILTER](state, data) {
    state.bundleProductSearchFilter = data
  },
  [T.SET_BUNDLE_CART_DETAILS](state, data) {
    state.bundleCartDetails = data
  },
  [T.CLEAR_LOADED_DATA](state, type) {
    if (type === 'myBundle' || !type) {
      state.bundleDetails = {}
      state.bundleTempData = {}
      state.bundleCountryId = false
      state.bundleProductSearchFilter = { selectedSort: 1, selectedCategory: null, search: '', perPage: 12 }
      state.bundleCartDetails = { bundleItems: [], bundleTotal: { member_price: 0, retail_price: 0 } }
    }
  },
}
