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.
This commit is contained in:
Copilot
2025-11-19 21:18:28 -08:00
committed by GitHub
parent 6238502b9a
commit 0cbd9efda3
2 changed files with 4 additions and 6 deletions
@@ -150,7 +150,7 @@
bind:selectedAddress={billingAddress} />
{/if}
{#if showReplace}
<ReplaceAddress bind:show={showReplace} />
<ReplaceAddress bind:show={showReplace} {locale} {countryList} />
{/if}
{#if showRemove}
<RemoveAddress bind:show={showRemove} />
@@ -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,