mirror of
https://github.com/pawelmalak/flame.git
synced 2025-08-06 19:25:17 +02:00
Add and update custom queries
This commit is contained in:
parent
a885440fef
commit
38ffdf1bff
8 changed files with 159 additions and 25 deletions
|
@ -48,6 +48,13 @@ const deleteQuery = (state: State, action: Action): State => {
|
|||
};
|
||||
};
|
||||
|
||||
const updateQuery = (state: State, action: Action): State => {
|
||||
return {
|
||||
...state,
|
||||
customQueries: action.payload,
|
||||
};
|
||||
};
|
||||
|
||||
const configReducer = (state: State = initialState, action: Action) => {
|
||||
switch (action.type) {
|
||||
case ActionTypes.getConfig:
|
||||
|
@ -60,6 +67,8 @@ const configReducer = (state: State = initialState, action: Action) => {
|
|||
return addQuery(state, action);
|
||||
case ActionTypes.deleteQuery:
|
||||
return deleteQuery(state, action);
|
||||
case ActionTypes.updateQuery:
|
||||
return updateQuery(state, action);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue