diff --git a/client/data/disputes/resolvers.js b/client/data/disputes/resolvers.js index bf45770537c..e68c2908bae 100644 --- a/client/data/disputes/resolvers.js +++ b/client/data/disputes/resolvers.js @@ -20,6 +20,7 @@ import { updateDisputesSummary, updateErrorForDispute, } from './actions'; +import { disputeAwaitingResponseStatuses } from 'wcpay/disputes/filters/config'; const formatQueryFilters = ( query ) => ( { user_email: query.userEmail, @@ -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; } diff --git a/client/disputes/index.tsx b/client/disputes/index.tsx index 060afccce35..cdb85131f5d 100644 --- a/client/disputes/index.tsx +++ b/client/disputes/index.tsx @@ -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(); @@ -407,6 +408,7 @@ export const DisputesList = (): JSX.Element => { dateBefore, dateBetween, match, + filter, statusIs, statusIsNot, } ),