Skip to content

Commit a98e0ef

Browse files
authored
Merge pull request #2677 from Northeastern-Electric-Racing/2674-bug-denied-request-amounts-are-still-included-in-the-currently-owed-total-1
#2674 Fixed reimbursement request bug
2 parents 618f928 + 422ce32 commit a98e0ef

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/frontend/src/pages/FinancePage/RefundsSection.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useState } from 'react';
1616
import { useAllReimbursements, useCurrentUserReimbursements } from '../../hooks/finance.hooks';
1717
import ErrorPage from '../ErrorPage';
1818
import LoadingIndicator from '../../components/LoadingIndicator';
19-
import { Reimbursement, ReimbursementRequest, isAdmin } from 'shared';
19+
import { Reimbursement, ReimbursementRequest, ReimbursementStatusType, isAdmin } from 'shared';
2020
import { useCurrentUser } from '../../hooks/users.hooks';
2121
import { centsToDollar, datePipe, fullNamePipe } from '../../utils/pipes';
2222
import NERProgressBar from '../../components/NERProgressBar';
@@ -121,8 +121,12 @@ const Refunds = ({ userReimbursementRequests, allReimbursementRequests }: Refund
121121
return <LoadingIndicator />;
122122

123123
const displayedReimbursements = allReimbursements && tabValue === 1 ? allReimbursements : userReimbursements;
124-
const displayedReimbursementRequests =
125-
allReimbursementRequests && tabValue === 1 ? allReimbursementRequests : userReimbursementRequests;
124+
const displayedReimbursementRequests = (
125+
allReimbursementRequests && tabValue === 1 ? allReimbursementRequests : userReimbursementRequests
126+
).filter(
127+
(request: ReimbursementRequest) =>
128+
!request.reimbursementStatuses.some((status) => status.type === ReimbursementStatusType.DENIED)
129+
);
126130

127131
const rows = displayedReimbursements.map(getRefundRowData).sort(getComparator(order, orderBy));
128132

0 commit comments

Comments
 (0)