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

22 lines
515 B
JavaScript

import * as types from "./actionTypes";
import * as api from "./api";
import {
beginApiCall,
apiCallError
} from "../../redux/actions/apiStatusActions";
export function loadSystemDateTime() {
return function (dispatch) {
dispatch(beginApiCall());
return api
.getSystemDateTime()
.then((data) => {
dispatch({ type: types.LOAD_SYSTEM_DATETIME_SUCCESS, payload: data });
})
.catch((error) => {
dispatch(apiCallError(error));
throw error;
});
};
}