grafana/public/app/features/variables/constant/actions.ts
Hugo Häggmark 1db067396a
Variables: migrates data source variable type to React/Redux (#22770)
* Refactor: moves all the newVariables part to features/variables directory

* Feature: adds datasource type

* Tests: adds reducer tests

* Tests: covers data source actions with tests

* Chore: reduces strict null errors
2020-03-16 06:32:04 +01:00

12 lines
527 B
TypeScript

import { validateVariableSelectionState } from '../state/actions';
import { ThunkResult } from 'app/types';
import { createConstantOptionsFromQuery } from './reducer';
import { toVariablePayload, VariableIdentifier } from '../state/types';
export const updateConstantVariableOptions = (identifier: VariableIdentifier): ThunkResult<void> => {
return async dispatch => {
await dispatch(createConstantOptionsFromQuery(toVariablePayload(identifier)));
await dispatch(validateVariableSelectionState(identifier));
};
};