fix: DataExportSection error
- Fixed improper referencing for PlatformServiceMixin - Fixed case where exported data has no contact methods authored-by: Matthew Raymer <matthew.raymer@anomalistdesign.com>
This commit is contained in:
@@ -178,8 +178,8 @@ export default class DataExportSection extends Vue {
|
||||
try {
|
||||
this.isExporting = true;
|
||||
|
||||
// Fetch contacts from database using database utility
|
||||
const allContacts = await this.$databaseUtil.getContacts();
|
||||
// Fetch contacts from database using mixin's cached method
|
||||
const allContacts = await this.$contacts();
|
||||
|
||||
// Convert contacts to export format
|
||||
const processedContacts: Contact[] = allContacts.map((contact) => {
|
||||
@@ -187,8 +187,10 @@ export default class DataExportSection extends Vue {
|
||||
const exContact: Contact = R.omit(["contactMethods"], contact);
|
||||
// now add contactMethods as a true array of ContactMethod objects
|
||||
exContact.contactMethods = contact.contactMethods
|
||||
? JSON.parse(contact.contactMethods as string)
|
||||
: undefined;
|
||||
? (typeof contact.contactMethods === 'string' && contact.contactMethods.trim() !== ''
|
||||
? JSON.parse(contact.contactMethods)
|
||||
: [])
|
||||
: [];
|
||||
return exContact;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user