Skip to content

Commit

Permalink
Fix awaiting response filtering in disputes CSV export
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessy committed Dec 18, 2024
1 parent cf6d2c1 commit 09d7c8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/data/disputes/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
updateDisputesSummary,
updateErrorForDispute,
} from './actions';
import { disputeAwaitingResponseStatuses } from 'wcpay/disputes/filters/config';

const formatQueryFilters = ( query ) => ( {
user_email: query.userEmail,
Expand All @@ -38,11 +39,18 @@ const formatQueryFilters = ( query ) => ( {
} );

export function getDisputesCSV( query ) {
const queryWithSearch = {
...query,
search:
query.filter === 'awaiting_response'
? disputeAwaitingResponseStatuses
: query.search,
};

const path = addQueryArgs(
`${ NAMESPACE }/disputes/download`,
formatQueryFilters( query )
formatQueryFilters( queryWithSearch )
);

return path;
}

Expand Down
2 changes: 2 additions & 0 deletions client/disputes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export const DisputesList = (): JSX.Element => {
date_after: dateAfter,
date_between: dateBetween,
match,
filter,
status_is: statusIs,
status_is_not: statusIsNot,
} = getQuery();
Expand Down Expand Up @@ -407,6 +408,7 @@ export const DisputesList = (): JSX.Element => {
dateBefore,
dateBetween,
match,
filter,
statusIs,
statusIsNot,
} ),
Expand Down

0 comments on commit 09d7c8d

Please sign in to comment.