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 {rows: filteredRows, renderSearch} = useListSearch(paypalFilterRows, updatedPaypalPayments);
const paypalTable = useReactTable({ const paypalTable = useReactTable({
data: filteredRows, data: filteredRows.sort((a, b) => moment(b.createdAt).diff(moment(a.createdAt), "second")),
columns: paypalColumns, columns: paypalColumns,
getCoreRowModel: getCoreRowModel(), getCoreRowModel: getCoreRowModel(),
}); });
const getUserModal = () => { const getUserModal = () => {
if (user) { if (user) {
if (selectedCorporateUser) { if (selectedCorporateUser) {
@@ -888,7 +889,7 @@ export default function PaymentRecord() {
const {rows: csvRows, columns: csvColumns} = getCSVData(); const {rows: csvRows, columns: csvColumns} = getCSVData();
const renderTable = (table: Table<any>) => ( 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> <thead>
{table.getHeaderGroups().map((headerGroup) => ( {table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}> <tr key={headerGroup.id}>