import { companyInfo, addCompanyInfo } from '@/api/company'

const company = {
  namespaced: true,

  actions: {
    getCompanyInfo({ commit, state }, data) {
      return new Promise((resolve, reject) => {
        companyInfo(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    createCompanyInfo({ commit, state }, data) {
      return new Promise((resolve, reject) => {
        addCompanyInfo(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default company
