reverse-proxy-frontend/src/features/session/actionCreators.js

16 lines
489 B
JavaScript
Raw Normal View History

2020-05-12 02:31:25 +03:00
import * as types from "./actionTypes";
import api from "./api";
import { sendHttpRequest } from "../../redux/actions/httpActions";
export function loadServerSessions() {
return async function (dispatch) {
try {
dispatch({ type: types.LOAD_SERVER_SESSIONS_STARTED });
const data = await dispatch(sendHttpRequest(api.getServerSessions()));
dispatch({ type: types.LOAD_SERVER_SESSIONS_SUCCESS, payload: data });
} catch (error) {
throw error;
}
};
}