@xuda.io/account_module 1.2.1353 → 1.2.1354

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 +4 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1968,7 +1968,8 @@ export const add_contact = async function (req, job_id, headers) {
1968
1968
  };
1969
1969
  const user_contacts = await find_contact_query(uid, opt);
1970
1970
  if (user_contacts.docs.length) {
1971
- throw new Error('contact already exist');
1971
+ // throw new Error('contact already exist');
1972
+ return { code: -1, data: 'contact already exist', contact_id: user_contacts.docs[0]._id };
1972
1973
  }
1973
1974
 
1974
1975
  /////////////////
@@ -2023,7 +2024,7 @@ export const add_contact = async function (req, job_id, headers) {
2023
2024
  profile_avatar_obj,
2024
2025
  account_profiles: [account_profile_obj._id],
2025
2026
  };
2026
- const ret = await save_contact(uid, doc);
2027
+ const save_ret = await save_contact(uid, doc);
2027
2028
 
2028
2029
  if (!account_info_ret?.data?.profile_avatar) {
2029
2030
  const app_id = await get_account_default_project_id(uid);
@@ -2040,7 +2041,7 @@ export const add_contact = async function (req, job_id, headers) {
2040
2041
  }
2041
2042
  }
2042
2043
  }
2043
- return ret;
2044
+ return save_ret;
2044
2045
  } catch (err) {
2045
2046
  return { code: -1, data: err.message };
2046
2047
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1353",
3
+ "version": "1.2.1354",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {