ENCOA-66: Payment record not sorting

This commit is contained in:
Tiago Ribeiro
2024-07-18 15:45:28 +01:00
parent a1b67c017d
commit 41873f80d7

View File

@@ -788,10 +788,11 @@ export default function PaymentRecord() {
const {rows: filteredRows, renderSearch} = useListSearch(paypalFilterRows, updatedPaypalPayments);
const paypalTable = useReactTable({
data: filteredRows,
data: filteredRows.sort((a, b) => moment(b.createdAt).diff(moment(a.createdAt), "second")),
columns: paypalColumns,
getCoreRowModel: getCoreRowModel(),
});
const getUserModal = () => {
if (user) {
if (selectedCorporateUser) {
@@ -888,7 +889,7 @@ export default function PaymentRecord() {
const {rows: csvRows, columns: csvColumns} = getCSVData();
const renderTable = (table: Table<any>) => (
<table className="rounded-xl bg-mti-purple-ultralight/40 w-full">
<table className="rounded-xl h-full bg-mti-purple-ultralight/40 w-full">
<thead>
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>