feat: Items data table.

This commit is contained in:
Ahmed Bouhuolia
2020-03-25 18:05:15 +02:00
parent 1894ad3b18
commit edd8693450
22 changed files with 567 additions and 20 deletions

View File

@@ -4,9 +4,10 @@ export const pickItemsFromIds = (items, ids) => {
return Object.values(pick(items, ids));
}
export const getCurrentPageResults = (items, page, name) => {
const currentPage = page.pages[page.currentPages[name]]
return typeof currentPage == 'undefined' ? [] : Object.values(pick(items || [], currentPage.ids))
export const getCurrentPageResults = (items, pages, pageNumber) => {
const currentPage = pages[pageNumber]
return typeof currentPage == 'undefined' ?
[] : Object.values(pick(items || [], currentPage.ids));
}
export const getCurrentTotalResultsCount = (pagination, name) => {