mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
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:
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({
|
||||
|
||||
Reference in New Issue
Block a user