diff --git a/billing/src/App.vue b/billing/src/App.vue index 69356ae8dd..0b61001e99 100644 --- a/billing/src/App.vue +++ b/billing/src/App.vue @@ -17,6 +17,14 @@ import PageNotFound from './pages/PageNotFound.vue' import AppSidebar from '@/components/AppSidebar.vue' import { Dialogs } from '@/dialogs.js' import { Toasts, createResource } from 'frappe-ui' +import { provide } from 'vue' + +const team = createResource({ + url: 'frappe.integrations.frappe_providers.frappecloud_billing.api', + params: { method: 'team.info' }, + cache: 'team', + auto: true, +}) const isFCSite = createResource({ url: 'frappe.integrations.frappe_providers.frappecloud_billing.is_fc_site', @@ -24,4 +32,6 @@ const isFCSite = createResource({ auto: true, transform: (data) => Boolean(data), }) + +provide('team', team) diff --git a/billing/src/components/AddressForm.vue b/billing/src/components/AddressForm.vue index 066396ddca..39af9994ad 100644 --- a/billing/src/components/AddressForm.vue +++ b/billing/src/components/AddressForm.vue @@ -37,7 +37,7 @@ import { FormControl, ErrorMessage, createResource, toast } from 'frappe-ui' import { ref, computed, inject, watch } from 'vue' const emit = defineEmits(['success']) -const { team } = inject('billing') +const team = inject('team') const billingInformation = defineModel() @@ -135,7 +135,7 @@ const _countryList = createResource({ cache: 'countryList', auto: true, onSuccess: () => { - let userCountry = team.value?.country + let userCountry = team.data?.country if (userCountry) { let country = countryList.value?.find((d) => d.label === userCountry) if (country) { diff --git a/billing/src/components/BuyCreditsRazorpay.vue b/billing/src/components/BuyCreditsRazorpay.vue index 5d2f5c2e0d..bc4b17d0c8 100644 --- a/billing/src/components/BuyCreditsRazorpay.vue +++ b/billing/src/components/BuyCreditsRazorpay.vue @@ -1,7 +1,7 @@