Automattic/woocommerce-payments

TS error due to missing API response type assertion when sending a CSV export request to `/disputes/download`

Closed this issue · 0 comments

Describe the bug

A TS error is present due to missing API response type assertion when sending a CSV export request to /disputes/download:

const { exported_disputes: exportedDisputes } = await apiFetch(

Property 'exported_disputes' does not exist on type 'unknown'.ts(2339)

Since we know the shape of the response object as returned by transact-platform-server, we should add a type assertion here to improve code quality and make the expected API response structure clear to future devs.