@xuda.io/account_module 1.2.348 → 1.2.350

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +8 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1577,23 +1577,31 @@ export const update_contacts_with_account_changes = async function (uid, changes
1577
1577
  selector: { contact_uid: uid, docType: 'contact' },
1578
1578
  };
1579
1579
  debugger;
1580
+ let changes_made;
1580
1581
  var contacts = await db_module.find_couch_query('xuda_contacts', opt);
1581
1582
  for (let doc of contacts.docs) {
1582
1583
  if (changes.includes('profile_picture')) {
1584
+ changes_made = true;
1583
1585
  doc.profile_picture = account_obj.account_info.profile_picture;
1584
1586
  }
1585
1587
  if (changes.includes('profile_avatar')) {
1588
+ changes_made = true;
1586
1589
  doc.profile_avatar = account_obj.account_info.profile_avatar;
1587
1590
  }
1588
1591
  if (changes.includes('email')) {
1592
+ changes_made = true;
1589
1593
  doc.email = account_obj.account_info.email;
1590
1594
  }
1591
1595
  if (changes.includes('first_name') || changes.includes('last_name')) {
1596
+ changes_made = true;
1592
1597
  doc.name = `${account_obj.account_info.first_name} ${account_obj.account_info.last_name}`;
1593
1598
  }
1594
1599
 
1595
1600
  console.log(doc);
1596
1601
  }
1602
+ if (contacts.docs && changes_made) {
1603
+ await db_module.save_couch_bulk_docs('xuda_contacts', contacts.docs);
1604
+ }
1597
1605
 
1598
1606
  return username;
1599
1607
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.348",
3
+ "version": "1.2.350",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {