mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: Accounts datatable.
This commit is contained in:
28
client/src/store/queryReducers.js
Normal file
28
client/src/store/queryReducers.js
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
export const createTableQueryReducers =
|
||||
(resourceName = '', reducer) =>
|
||||
(state, action) => {
|
||||
const RESOURCE_NAME = resourceName.toUpperCase();
|
||||
|
||||
switch (action.type) {
|
||||
case `${RESOURCE_NAME}_TABLE_QUERY_SET`:
|
||||
return {
|
||||
...state,
|
||||
tableQuery: {
|
||||
...state.tableQuery,
|
||||
[state.key]: state.value,
|
||||
}
|
||||
};
|
||||
case `${RESOURCE_NAME}_TABLE_QUERIES_ADD`:
|
||||
return {
|
||||
...state,
|
||||
tableQuery: {
|
||||
...state.tableQuery,
|
||||
...action.queries
|
||||
},
|
||||
};
|
||||
default:
|
||||
return reducer(state, action);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user