mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
17 lines
433 B
TypeScript
17 lines
433 B
TypeScript
|
import { ApiKeysState } from 'app/types';
|
|||
|
import { Action, ActionTypes } from './actions';
|
|||
|
|
|||
|
export const initialApiKeysState: ApiKeysState = { keys: [] };
|
|||
|
|
|||
|
export const apiKeysReducer = (state = initialApiKeysState, action: Action): ApiKeysState => {
|
|||
|
switch (action.type) {
|
|||
|
case ActionTypes.LoadApiKeys:
|
|||
|
return { ...state, keys: action.payload };
|
|||
|
}
|
|||
|
return state;
|
|||
|
};
|
|||
|
|
|||
|
export default {
|
|||
|
apiKeys: apiKeysReducer,
|
|||
|
};
|