fix linting

This commit is contained in:
2025-06-07 15:40:52 -06:00
parent 41dad3254d
commit 9ac9713172
6 changed files with 45 additions and 31 deletions

View File

@@ -889,30 +889,34 @@ export interface DatabaseExport {
/**
* Converts an array of contacts to the standardized database export JSON format.
* This format is used for data migration and backup purposes.
*
*
* @param contacts - Array of Contact objects to convert
* @returns DatabaseExport object in the standardized format
*/
export const contactsToExportJson = (contacts: Contact[]): DatabaseExport => {
// Convert each contact to a plain object and ensure all fields are included
const rows = contacts.map(contact => ({
const rows = contacts.map((contact) => ({
did: contact.did,
name: contact.name || null,
contactMethods: contact.contactMethods ? JSON.stringify(contact.contactMethods) : null,
contactMethods: contact.contactMethods
? JSON.stringify(contact.contactMethods)
: null,
nextPubKeyHashB64: contact.nextPubKeyHashB64 || null,
notes: contact.notes || null,
profileImageUrl: contact.profileImageUrl || null,
publicKeyBase64: contact.publicKeyBase64 || null,
seesMe: contact.seesMe || false,
registered: contact.registered || false
registered: contact.registered || false,
}));
return {
data: {
data: [{
tableName: "contacts",
rows
}]
}
data: [
{
tableName: "contacts",
rows,
},
],
},
};
};