fix(payments): fix TypeScript cast errors in polar webhook handler
Some checks failed
CI / UI (push) Successful in 25s
Release / Test backend (push) Successful in 22s
CI / Backend (push) Successful in 1m59s
Release / Check ui (push) Successful in 27s
Release / Docker / caddy (push) Successful in 44s
CI / UI (pull_request) Successful in 27s
CI / Backend (pull_request) Failing after 1m26s
Release / Docker / runner (push) Successful in 1m40s
Release / Docker / backend (push) Successful in 2m34s
Release / Docker / ui (push) Successful in 3m21s
Release / Gitea Release (push) Successful in 13s

Cast through unknown to satisfy TS strict overlap check for
PolarSubscription and PolarOrder types from Record<string, unknown>.
This commit is contained in:
Admin
2026-03-31 23:40:11 +05:00
parent 23ae1ed500
commit 1e9a96aa0f

View File

@@ -42,11 +42,11 @@ export const POST: RequestHandler = async ({ request }) => {
case 'subscription.updated':
case 'subscription.canceled':
case 'subscription.revoked':
await handleSubscriptionEvent(type, data as Parameters<typeof handleSubscriptionEvent>[1]);
await handleSubscriptionEvent(type, data as unknown as Parameters<typeof handleSubscriptionEvent>[1]);
break;
case 'order.created':
await handleOrderCreated(data as Parameters<typeof handleOrderCreated>[0]);
await handleOrderCreated(data as unknown as Parameters<typeof handleOrderCreated>[0]);
break;
default: