@xuda.io/account_module 1.2.1056 → 1.2.1057

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 +17 -17
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2612,13 +2612,13 @@ export const archive_account_profile = async function (req) {
2612
2612
  export const delete_profile = async function (req, job_id, headers) {
2613
2613
  const { profile_id } = req;
2614
2614
  try {
2615
- var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', profile_id);
2615
+ var contact_profile_doc = await db_module.get_couch_doc_native('xuda_contacts', profile_id);
2616
2616
 
2617
- contact_doc.stat = 4;
2618
- contact_doc.stat_ts = Date.now();
2619
- contact_doc.stat_reason = 'deleted by the user';
2617
+ contact_profile_doc.stat = 4;
2618
+ contact_profile_doc.stat_ts = Date.now();
2619
+ contact_profile_doc.stat_reason = 'deleted by the user';
2620
2620
 
2621
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2621
+ const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_profile_doc);
2622
2622
 
2623
2623
  ai_module.delete_depended_chats(uid, profile_id);
2624
2624
  return contact_save_ret;
@@ -2633,17 +2633,17 @@ export const delete_profile = async function (req, job_id, headers) {
2633
2633
  export const unarchive_profile = async function (req) {
2634
2634
  const { profile_id } = req;
2635
2635
  try {
2636
- var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', profile_id);
2636
+ var contact_profile_doc = await db_module.get_couch_doc_native('xuda_contacts', profile_id);
2637
2637
 
2638
- if (contact_doc.stat !== 5) {
2638
+ if (contact_profile_doc.stat !== 5) {
2639
2639
  throw new Error('contact is not archived');
2640
2640
  }
2641
2641
 
2642
- contact_doc.stat = 3;
2643
- contact_doc.stat_ts = Date.now();
2644
- contact_doc.stat_reason = 'archived by the user';
2642
+ contact_profile_doc.stat = 3;
2643
+ contact_profile_doc.stat_ts = Date.now();
2644
+ contact_profile_doc.stat_reason = 'archived by the user';
2645
2645
 
2646
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2646
+ const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_profile_doc);
2647
2647
 
2648
2648
  return contact_save_ret;
2649
2649
  } catch (err) {
@@ -2661,18 +2661,18 @@ export const unfriend_profile = async function (req) {
2661
2661
  if (contact_ret.code < 0) {
2662
2662
  throw new Error(contact_ret.data);
2663
2663
  }
2664
- var contact_doc = contact_ret.data;
2664
+ var contact_profile_doc = contact_ret.data;
2665
2665
 
2666
- if (!contact_doc.team_req_id) {
2666
+ if (!contact_profile_doc.team_req_id) {
2667
2667
  throw new Error('no friend relationship found');
2668
2668
  }
2669
- let req_doc = await db_module.get_couch_doc_native('xuda_team', contact_doc.team_req_id);
2669
+ let req_doc = await db_module.get_couch_doc_native('xuda_team', contact_profile_doc.team_req_id);
2670
2670
  req_doc.team_req_stat = 4;
2671
2671
  req_doc.team_req_stat_desc = 'unfriend by the user';
2672
- await db_module.get_couch_doc_native('xuda_team', contact_doc.team_req_id);
2672
+ await db_module.get_couch_doc_native('xuda_team', contact_profile_doc.team_req_id);
2673
2673
 
2674
- contact_doc.team_req_id = null;
2675
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2674
+ contact_profile_doc.team_req_id = null;
2675
+ const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_profile_doc);
2676
2676
 
2677
2677
  const req_save_ret = await db_module.save_couch_doc('xuda_team', req_doc);
2678
2678
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1056",
3
+ "version": "1.2.1057",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {