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

// 추천 Keyword 목록 조회 IF-LGSP-055
export const getMyRecommandedKeyword = () => (dispatch, getState) => {
  const onSuccess = (response) => {
    console.log("getMyRecommandedKeyword onSuccess ", response.data);

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

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

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