import mzService from '../../../services/mz/index';
import { ActionContext, ActionTree, mapActions } from 'vuex';

export const state = {};

export const getters = {};

export const mutations = {};

export const actions: ActionTree<any, any> = {
  getDiscoveryInfo({ commit }: ActionContext<any, any>, className: string) {
    return new Promise((resolve, reject) => {
      mzService
        .getDiscoveryByClass(className)
        .then((data) => {
          resolve(data);
        })
        .catch((e) => {
          reject(e);
        });
    });
  },
};

export const mzDiscoveryMethods = mapActions('mz/discovery', [
  'getDiscoveryInfo',
]);
