Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const updateOwner = () => (dispatch, getState) => {
return dispatch({
type: FLOW_UPDATE_OWNER,
payload: UserSelectors.getUserAlias(getState())
});
};
const flow = Helpers.convertConfigToFlow(config);
return dispatch({
type: FLOW_INIT,
payload: flow
});
})
.then(flow => {
dispatch(QueryActions.initQuery(flow.payload.query));
})
.catch(error => {
const message = getApiErrorMessage(error);
updateErrorMessage(dispatch, message);
return Q.reject({ error: true, message: message });
});
} else {
const owner = UserSelectors.getUserAlias(getState());
dispatch(QueryActions.initQuery(QueryModels.defaultQuery));
return dispatch({
type: FLOW_NEW,
payload: owner
});
}
};