mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: Items data table.
This commit is contained in:
27
client/src/store/paginator.reducer.js
Normal file
27
client/src/store/paginator.reducer.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const pages = (pages, action) => {
|
||||
const { type, items, meta } = action;
|
||||
|
||||
switch(type) {
|
||||
case REQUEST_PAGE:
|
||||
return {
|
||||
...pages,
|
||||
[meta.currentPage]: {
|
||||
...pages[meta.currentPage],
|
||||
ids: [],
|
||||
fetching: true,
|
||||
},
|
||||
};
|
||||
case RECEIVE_PAGE:
|
||||
return {
|
||||
...pages,
|
||||
[meta.currentPage]: {
|
||||
...pages[meta.currentPage],
|
||||
ids: items.map(i => i.id),
|
||||
fetching: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user