Skip to content

Commit 0cbd9ef

Browse files
authored
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.
1 parent 6238502 commit 0cbd9ef

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/routes/(console)/organization-[organization]/billing/billingAddress.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
bind:selectedAddress={billingAddress} />
151151
{/if}
152152
{#if showReplace}
153-
<ReplaceAddress bind:show={showReplace} />
153+
<ReplaceAddress bind:show={showReplace} {locale} {countryList} />
154154
{/if}
155155
{#if showRemove}
156156
<RemoveAddress bind:show={showRemove} />

src/routes/(console)/organization-[organization]/billing/replaceAddress.svelte

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
1212
import { base } from '$app/paths';
1313
import { Alert, Badge, Card, Layout, Skeleton } from '@appwrite.io/pink-svelte';
14-
import { page } from '$app/state';
14+
import type { Models } from '@appwrite.io/console';
1515
1616
export let show = false;
17+
export let locale: Models.Locale;
18+
export let countryList: Models.CountryList;
1719
let loading = true;
1820
let addresses: AddressesList;
1921
let selectedAddress: string;
@@ -44,13 +46,9 @@
4446
: null
4547
: null;
4648
47-
const locale = await sdk.forProject(page.params.region, page.params.project).locale.get();
4849
if (locale?.countryCode) {
4950
country = locale.countryCode;
5051
}
51-
const countryList = await sdk
52-
.forProject(page.params.region, page.params.project)
53-
.locale.listCountries();
5452
options = countryList.countries.map((country) => {
5553
return {
5654
value: country.code,

0 commit comments

Comments
 (0)