@xuda.io/account_module 1.2.1281 → 1.2.1283

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 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1125,7 +1125,7 @@ export const find_contact_duplicates = async function (req) {
1125
1125
  selector: {
1126
1126
  docType: 'contact',
1127
1127
  stat: { $lt: 4 },
1128
- uid,
1128
+ // uid,
1129
1129
  },
1130
1130
  limit: 999999,
1131
1131
  };
@@ -1133,7 +1133,7 @@ export const find_contact_duplicates = async function (req) {
1133
1133
  if (typeof name !== 'undefined') {
1134
1134
  opt.selector.name = name;
1135
1135
  }
1136
- const contact_ret = await db_module.find_couch_query('xuda_contacts', opt);
1136
+ const contact_ret = await find_contact_query(uid, opt);
1137
1137
  var duplicates = {};
1138
1138
  for (contact of contact_ret.docs) {
1139
1139
  if (!duplicates[contact.name]) {
@@ -2107,6 +2107,20 @@ export const add_contact = async function (req, job_id, headers) {
2107
2107
  throw new Error('contact already exist active or deleted');
2108
2108
  }
2109
2109
 
2110
+ //////////////////
2111
+ const opt = {
2112
+ selector: {
2113
+ docType: 'contact',
2114
+ stat: 3,
2115
+ email,
2116
+ },
2117
+ limit: 1,
2118
+ fields: ['_id'],
2119
+ };
2120
+ const user_contacts = await find_contact_query(req_obj.team_req_to_uid, opt);
2121
+
2122
+ /////////////////
2123
+
2110
2124
  let is_spam = false;
2111
2125
  let profile_avatar, profile_avatar_obj;
2112
2126
  let account_info_ret;
@@ -2138,7 +2152,7 @@ export const add_contact = async function (req, job_id, headers) {
2138
2152
  const d = Date.now();
2139
2153
  const doc = {
2140
2154
  _id: await _common.xuda_get_uuid('contact'),
2141
- email: [email],
2155
+ email,
2142
2156
  name,
2143
2157
  stat: stat || 1,
2144
2158
  date_created: d,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1281",
3
+ "version": "1.2.1283",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {