Files
shoptime/com.twin.app.shoptime/src/actions/playActions.js

63 lines
1.3 KiB
JavaScript

import { URLS } from '../api/apiConfig';
import { TAxios } from '../api/TAxios';
import { types } from './actionTypes';
// 채팅 로그 가져오기 IF-LGSP-371
export const getChatLog =
({ patnrId, showId }) =>
(dispatch, getState) => {
const onSuccess = (response) => {
console.log("getChatLog onSuccess", response.data);
dispatch({
type: types.GET_CHAT_LOG,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("getChatLog onFail", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.CHAT_LOG,
{ patnrId, showId },
{},
onSuccess,
onFail
);
};
// VOD 자막 가져오기 IF-LGSP-072
export const getSubTitle =
({ patnrId, showId }) =>
(dispatch, getState) => {
console.log("#patnrId, showId ", patnrId, showId);
const onSuccess = (response) => {
console.log("getSubTitle onSuccess", response.data);
dispatch({
type: types.GET_SUBTITLE,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("getSubTitle onFail", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.SUBTITLE,
{ patnrId, showId },
{},
onSuccess,
onFail
);
};