/* eslint-disable */
import axios from "axios";

export default {
  namespaced: true,
  state: {
    listingFee: []
  },
  mutations: {
    getListingFee: (state, fee) => (state.listingFee = fee),
    newListingFee: (state, fee) => (state.listingFee = fee)
  },
  getters: {
    getListingFee: state => state.listingFee
  },
  actions: {
    async retrieveListingFee({ commit }) {
      await axios.get("api/fees/listingFee").then(res => {
        commit("getListingFee", res.data);
      }).catch(ex => console.log(ex.response))
    },
    async setListingFee({ commit }, fee) {
      await axios.post("api/fees/listingFee", fee).then(res => {
        commit("newListingFee", res.data);
      }).catch(ex => console.log(ex.response))
    }
  }
};
