fix(contacts): expose root country code

This commit is contained in:
Sojan Jose
2026-05-27 01:17:09 +05:30
parent 4705a5c3ff
commit 25c11ecc56
10 changed files with 29 additions and 6 deletions
@@ -37,6 +37,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
countryCode: {
type: String,
default: '',
},
updatedAt: {
type: Number,
default: 0,
@@ -60,12 +64,17 @@ const updatedAtTime = computed(() => {
});
const countryDetails = computed(() => {
const { country, countryCode, city } = props.additionalAttributes;
const {
country,
countryCode: additionalCountryCode,
city,
} = props.additionalAttributes;
const countryCode = props.countryCode || additionalCountryCode;
if (!country && !countryCode) return null;
const activeCountry =
countriesMap.value[country] || countriesMap.value[countryCode];
countriesMap.value[countryCode] || countriesMap.value[country];
if (!activeCountry) return null;
@@ -41,6 +41,7 @@ const accountId = useMapGetter('getCurrentAccountId');
:name="contact.name"
:email="contact.email"
:phone="contact.phoneNumber"
:country-code="contact.countryCode"
:additional-attributes="contact.additionalAttributes"
:account-id="accountId"
:thumbnail="contact.thumbnail"