fix: correct type annotations for payment method promises

Promise type should include null for both the resolved value
(.catch(() => null)) and the ternary false branch (null).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Damodar Lohani
2026-04-07 01:01:15 +00:00
co-authored by Claude Opus 4.6
parent 56c959e90c
commit 784c4fda8d
@@ -70,16 +70,17 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => {
const areCreditsSupported = isCloud ? currentPlan?.supportsCredits : false;
const primaryPaymentMethodPromise: Promise<Models.PaymentMethod> = organization.paymentMethodId
? sdk.forConsole.organizations
.getPaymentMethod({
organizationId: organization.$id,
paymentMethodId: organization.paymentMethodId
})
.catch(() => null)
: null;
const primaryPaymentMethodPromise: Promise<Models.PaymentMethod | null> | null =
organization.paymentMethodId
? sdk.forConsole.organizations
.getPaymentMethod({
organizationId: organization.$id,
paymentMethodId: organization.paymentMethodId
})
.catch(() => null)
: null;
const backupPaymentMethodPromise: Promise<Models.PaymentMethod> =
const backupPaymentMethodPromise: Promise<Models.PaymentMethod | null> | null =
organization.backupPaymentMethodId
? sdk.forConsole.organizations
.getPaymentMethod({