fix: Display country name

This commit is contained in:
Ahmed Bouhuolia
2024-10-06 13:18:31 +02:00
parent 75ec315de2
commit df9d277e66
15 changed files with 659 additions and 65 deletions

View File

@@ -3,6 +3,7 @@ import {
organizationAddressTextFormat,
} from '@/utils/address-text-format';
import BaseModel from 'models/Model';
import { findByIsoCountryCode } from '@bigcapital/utils';
import { getUploadedObjectUri } from '../../services/Attachments/utils';
export default class TenantMetadata extends BaseModel {
@@ -70,6 +71,8 @@ export default class TenantMetadata extends BaseModel {
* @returns {string}
*/
public get addressTextFormatted() {
const addressCountry = findByIsoCountryCode(this.location);
return organizationAddressTextFormat(defaultOrganizationAddressFormat, {
organizationName: this.name,
address1: this.address?.address1,
@@ -78,7 +81,7 @@ export default class TenantMetadata extends BaseModel {
city: this.address?.city,
postalCode: this.address?.postalCode,
phone: this.address?.phone,
country: 'United State',
country: addressCountry?.name ?? '',
});
}
}