19 lines
527 B
JavaScript
19 lines
527 B
JavaScript
import * as types from "./actionTypes";
|
|
import api from "./api";
|
|
import { sendHttpRequest } from "../../redux/actions/httpActions";
|
|
|
|
export function loadFrontendSession() {
|
|
return async function (dispatch) {
|
|
try {
|
|
dispatch({ type: types.INITIALIZE_FRONTEND_SESSION_STARTED });
|
|
const data = await dispatch(sendHttpRequest(api.getFrontendSession()));
|
|
dispatch({
|
|
type: types.INITIALIZE_FRONTEND_SESSION_SUCCESS,
|
|
payload: data
|
|
});
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
}
|