import { fetchTemp, updateTemp } from '@/api/app-custom-center/tab-module-list'

const actions = {
  fetchTemp({ commit }, params) {
    return new Promise((resolve, reject) => {
      fetchTemp(params)
        .then(response => {
          const { data } = response
          resolve(data)
        })
        .catch(error => {
          console.error(error)
          reject(error)
        })
    })
  },
  updateTemp({ commit }, params) {
    return new Promise((resolve, reject) => {
      updateTemp(params)
        .then(response => {
          const { data } = response
          resolve(data)
        })
        .catch(error => {
          console.error(error)
          reject(error)
        })
    })
  }
}

export default {
  namespaced: true,
  actions
}
