1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-07 03:35:18 +02:00

Add and delete custom search provider actions and controllers

This commit is contained in:
unknown 2021-10-11 13:03:31 +02:00
parent 459523dfd2
commit a885440fef
15 changed files with 392 additions and 82 deletions

View file

@ -34,6 +34,20 @@ const fetchQueries = (state: State, action: Action): State => {
};
};
const addQuery = (state: State, action: Action): State => {
return {
...state,
customQueries: [...state.customQueries, action.payload],
};
};
const deleteQuery = (state: State, action: Action): State => {
return {
...state,
customQueries: action.payload,
};
};
const configReducer = (state: State = initialState, action: Action) => {
switch (action.type) {
case ActionTypes.getConfig:
@ -42,6 +56,10 @@ const configReducer = (state: State = initialState, action: Action) => {
return updateConfig(state, action);
case ActionTypes.fetchQueries:
return fetchQueries(state, action);
case ActionTypes.addQuery:
return addQuery(state, action);
case ActionTypes.deleteQuery:
return deleteQuery(state, action);
default:
return state;
}