@xuda.io/account_module 1.2.1272 → 1.2.1274

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 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1210,7 +1210,7 @@ export const merge_contact = async function (req) {
1210
1210
  primary_contact_doc.email.push(email_address);
1211
1211
  }
1212
1212
 
1213
- const primary_contact_save_ret = await db_module.save_couch_doc('xuda_contacts', primary_contact_doc);
1213
+ const primary_contact_save_ret = await save_contact(uid, primary_contact_doc);
1214
1214
 
1215
1215
  for (let contact_id of contact_to_delete) {
1216
1216
  try {
@@ -1218,7 +1218,7 @@ export const merge_contact = async function (req) {
1218
1218
  contact_doc.stat = 4;
1219
1219
  contact_doc.stat_ts = Date.now();
1220
1220
  contact_doc.stat_reason = 'merge';
1221
- await db_module.save_couch_doc('xuda_contacts', contact_doc);
1221
+ await await save_contact(uid, contact_doc);
1222
1222
  } catch (error) {}
1223
1223
  }
1224
1224
 
@@ -2909,3 +2909,9 @@ const get_contact = async function (uid, contact_id) {
2909
2909
  const contact_ret = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
2910
2910
  return contact_ret;
2911
2911
  };
2912
+
2913
+ const save_contact = async function (uid, contact_doc) {
2914
+ const account_profile_info = await get_active_account_profile_info(uid);
2915
+ const contact_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_doc);
2916
+ return contact_ret;
2917
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1272",
3
+ "version": "1.2.1274",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {