Skip to content

Commit

Permalink
Send API error status as tracks error message to fix error of sending…
Browse files Browse the repository at this point in the history
… react jsx (Automattic#79575)
  • Loading branch information
agrullon95 authored Jul 19, 2023
1 parent af114d2 commit a15e351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export function DomainCodePair( {
saleCost,
currencyCode = 'USD',
refetch,
errorStatus,
} = validation;

useEffect( () => {
Expand All @@ -119,10 +120,10 @@ export function DomainCodePair( {
if ( shouldReportError && ! valid && message ) {
recordTracksEvent( 'calypso_domain_transfer_domain_error', {
domain,
error: message,
error: errorStatus ? errorStatus : message,
} );
}
}, [ shouldReportError, valid, domain, message ] );
}, [ shouldReportError, valid, domain, message, errorStatus ] );

return (
<div className="domains__domain-info-and-validation">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export function useValidationMessage( domain: string, auth: string, hasDuplicate
saleCost: validationResult?.sale_cost,
currencyCode: validationResult?.currency_code,
refetch,
errorStatus: validationResult?.status,
};
}

Expand All @@ -114,5 +115,6 @@ export function useValidationMessage( domain: string, auth: string, hasDuplicate
'An unknown error occurred while checking the domain transferability. Please try again or contact support'
),
refetch,
errorStatus: null,
};
}

0 comments on commit a15e351

Please sign in to comment.