From 0cbd9efda3ed5242e8dffab8a896b01604f12d99 Mon Sep 17 00:00:00 2001
From: Copilot <198982749+Copilot@users.noreply.github.com>
Date: Wed, 19 Nov 2025 21:18:28 -0800
Subject: [PATCH] Fix billing address replacement modal using undefined project
context (#2617)
Fix billing address replacement modal by using sdk.forConsole instead of sdk.forProject because project id is not available.
---
.../billing/billingAddress.svelte | 2 +-
.../billing/replaceAddress.svelte | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/routes/(console)/organization-[organization]/billing/billingAddress.svelte b/src/routes/(console)/organization-[organization]/billing/billingAddress.svelte
index f4422850c..238d0de7f 100644
--- a/src/routes/(console)/organization-[organization]/billing/billingAddress.svelte
+++ b/src/routes/(console)/organization-[organization]/billing/billingAddress.svelte
@@ -150,7 +150,7 @@
bind:selectedAddress={billingAddress} />
{/if}
{#if showReplace}
-
+
{/if}
{#if showRemove}
diff --git a/src/routes/(console)/organization-[organization]/billing/replaceAddress.svelte b/src/routes/(console)/organization-[organization]/billing/replaceAddress.svelte
index 4d5fa0577..5ef49d026 100644
--- a/src/routes/(console)/organization-[organization]/billing/replaceAddress.svelte
+++ b/src/routes/(console)/organization-[organization]/billing/replaceAddress.svelte
@@ -11,9 +11,11 @@
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { base } from '$app/paths';
import { Alert, Badge, Card, Layout, Skeleton } from '@appwrite.io/pink-svelte';
- import { page } from '$app/state';
+ import type { Models } from '@appwrite.io/console';
export let show = false;
+ export let locale: Models.Locale;
+ export let countryList: Models.CountryList;
let loading = true;
let addresses: AddressesList;
let selectedAddress: string;
@@ -44,13 +46,9 @@
: null
: null;
- const locale = await sdk.forProject(page.params.region, page.params.project).locale.get();
if (locale?.countryCode) {
country = locale.countryCode;
}
- const countryList = await sdk
- .forProject(page.params.region, page.params.project)
- .locale.listCountries();
options = countryList.countries.map((country) => {
return {
value: country.code,