import request from '../utils/request'
import getAPI from '../config/apis'
export default {
    namespaced: true,
      state: {
        activitydetail: {},
      },
      mutations: {
        updateActivity(state, activitydetail) {
          state.activitydetail = activitydetail;
        },
      },
      actions: {
        getActivity({ commit }, params) {
          return new Promise((resolve, reject) => {
            request({...getAPI('homepage.getactivity', params)}).then((data) => {
              commit('updateActivity', data)
              resolve()            
            }).catch(reject)
          });
        },
      }
    }