mirror of
https://dev.azure.com/tstanciu94/ReverseProxy/_git/ReverseProxy_Frontend
synced 2022-12-28 18:12:07 +02:00
26 lines
705 B
JavaScript
26 lines
705 B
JavaScript
import * as types from "./actionTypes";
|
|
import api from "./api";
|
|
import { sendHttpRequest } from "../../redux/actions/httpActions";
|
|
|
|
export function loadSystemData() {
|
|
return async function(dispatch) {
|
|
try {
|
|
const data = await dispatch(sendHttpRequest(api.getSystemData()));
|
|
dispatch({ type: types.LOAD_SYSTEM_DATA_SUCCESS, payload: data });
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
}
|
|
|
|
export function loadSystemVersion() {
|
|
return async function(dispatch) {
|
|
try {
|
|
const data = await dispatch(sendHttpRequest(api.getSystemVersion()));
|
|
dispatch({ type: types.LOAD_SYSTEM_VERSION_SUCCESS, payload: data });
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
}
|