mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
- Add the server_url_prefix flag for configuring this functionality - Add prefix handling to the server routes - Refactor JS to use appropriate paths from modules - Use JS template to get URL prefix into JS environment - Update webpack config to support prefixing Thanks to securityonion.net for sponsoring the development of this feature. Closes #1661
20 lines
608 B
JavaScript
20 lines
608 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 };
|