- re added tables with pagination;

This commit is contained in:
Vitalii Kiiko
2025-03-31 16:14:27 +02:00
parent 16602129f9
commit 713af3ac32
34 changed files with 1225 additions and 420 deletions

View File

@@ -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;