mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
19 lines
593 B
JavaScript
19 lines
593 B
JavaScript
import { push } from "react-router-redux";
|
|
import { join, omit, values } from "lodash";
|
|
|
|
import PATHS from "router/paths";
|
|
import queryActions from "redux/nodes/entities/queries/actions";
|
|
import { renderFlash } from "redux/nodes/notifications/actions";
|
|
|
|
export const fetchQuery = (dispatch, queryID) => {
|
|
return dispatch(queryActions.load(queryID)).catch((errors) => {
|
|
const errorMessage = join(values(omit(errors, "http_status")), ", ");
|
|
|
|
dispatch(push(PATHS.NEW_QUERY));
|
|
dispatch(renderFlash("error", errorMessage));
|
|
|
|
return false;
|
|
});
|
|
};
|
|
|
|
export default { fetchQuery };
|