- re added tables with pagination;
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { isEmpty, pathOr } from 'ramda';
|
||||
import formatDateString from './formatDateString';
|
||||
|
||||
const getQueryParamsForPaginatedEndpoint = (lazyState, statuses) => {
|
||||
const getQueryParamsForPaginatedEndpoint = (lazyState, statuses, sortByCol = 'applicationId') => {
|
||||
let sortBy = {
|
||||
columnName: 'applicationId',
|
||||
columnName: sortByCol,
|
||||
sortDesc: true
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ const getQueryParamsForPaginatedEndpoint = (lazyState, statuses) => {
|
||||
sortDesc: lazyState.sortOrder === -1
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
globalFilters: {
|
||||
page: lazyState.page ? lazyState.page + 1 : 1,
|
||||
@@ -22,9 +23,10 @@ const getQueryParamsForPaginatedEndpoint = (lazyState, statuses) => {
|
||||
status: statuses,
|
||||
filters: Object.keys(lazyState.filters).reduce((acc, cur) => {
|
||||
const value = pathOr('', ['filters', cur, 'value'], lazyState);
|
||||
const matchMode = pathOr('', ['filters', cur, 'matchMode'], lazyState);
|
||||
if (!isEmpty(value)) {
|
||||
acc[cur] = typeof value.getMonth === 'function'
|
||||
? formatDateString(value)
|
||||
? {value: formatDateString(value), matchMode}
|
||||
: lazyState.filters[cur];
|
||||
}
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user