From 2dc0b25c1bc37609df12f54df6d60fed919655ea Mon Sep 17 00:00:00 2001 From: Nnachevvv Date: Sat, 4 Nov 2023 18:51:06 +0200 Subject: [PATCH 1/3] Add if check to refund only stripe donations --- src/components/admin/donations/grid/Grid.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/donations/grid/Grid.tsx b/src/components/admin/donations/grid/Grid.tsx index 5f9762e2e..d4a55a556 100644 --- a/src/components/admin/donations/grid/Grid.tsx +++ b/src/components/admin/donations/grid/Grid.tsx @@ -154,7 +154,7 @@ export default observer(function Grid() { width: 120, resizable: false, renderCell: (params: GridRenderCellParams) => { - return params.row?.status === 'succeeded' ? ( + return params.row?.status === 'succeeded' && params.row?.provider === 'stripe' ? ( <> Date: Mon, 6 Nov 2023 11:45:56 +0200 Subject: [PATCH 2/3] Use enum for variables --- src/components/admin/donations/grid/Grid.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/admin/donations/grid/Grid.tsx b/src/components/admin/donations/grid/Grid.tsx index d4a55a556..2a67b1609 100644 --- a/src/components/admin/donations/grid/Grid.tsx +++ b/src/components/admin/donations/grid/Grid.tsx @@ -27,6 +27,7 @@ import { useStores } from '../../../../common/hooks/useStores' import RenderEditBillingEmailCell from './RenderEditBillingEmailCell' import RestoreIcon from '@mui/icons-material/Restore' import RefundModal from '../modals/RefundModal' +import { DonationStatus, PaymentProvider } from '../../../../gql/donations.enums' interface RenderCellProps { params: GridRenderCellParams @@ -154,7 +155,7 @@ export default observer(function Grid() { width: 120, resizable: false, renderCell: (params: GridRenderCellParams) => { - return params.row?.status === 'succeeded' && params.row?.provider === 'stripe' ? ( + return params.row?.status === DonationStatus.succeeded && params.row?.provider === PaymentProvider.stripe ? ( <> Date: Mon, 6 Nov 2023 12:06:07 +0200 Subject: [PATCH 3/3] Fix prettier --- src/components/admin/donations/grid/Grid.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/admin/donations/grid/Grid.tsx b/src/components/admin/donations/grid/Grid.tsx index 2a67b1609..5899f3c6f 100644 --- a/src/components/admin/donations/grid/Grid.tsx +++ b/src/components/admin/donations/grid/Grid.tsx @@ -155,7 +155,8 @@ export default observer(function Grid() { width: 120, resizable: false, renderCell: (params: GridRenderCellParams) => { - return params.row?.status === DonationStatus.succeeded && params.row?.provider === PaymentProvider.stripe ? ( + return params.row?.status === DonationStatus.succeeded && + params.row?.provider === PaymentProvider.stripe ? ( <>