import { URLS } from '../api/apiConfig';
import { TAxios } from '../api/TAxios';
import { types } from './actionTypes';

// IF-LGSPM-373 EMP Shoptime 선택 약관 조회
export const getShoptimeTerms = () => (dispatch, getState) => {
  const onSuccess = (response) => {
    console.log("getShoptimeTerms onSuccess ", response.data);

    dispatch({
      type: types.GET_SHOPTIME_TERMS,
      payload: response.data.data,
    });
  };

  const onFail = (error) => {
    console.error("getShoptimeTerms onFail ", error);
  };

  TAxios(
    dispatch,
    getState,
    "get",
    URLS.GET_SHOPTIME_TERMS,
    {},
    {},
    onSuccess,
    onFail
  );
};
