@xuda.io/account_module 1.2.1352 → 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.
- package/index.mjs +5 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1277,7 +1277,7 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1277
1277
|
try {
|
|
1278
1278
|
doc.phone_number = formatPhoneWithFlag(account_info_ret.data.phone_number, account_info_ret.data.country);
|
|
1279
1279
|
} catch (err) {
|
|
1280
|
-
console.error(err);
|
|
1280
|
+
// console.error(err);
|
|
1281
1281
|
doc.phone_number = account_info_ret.data.phone_number;
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
@@ -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
|
|
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
|
|
2044
|
+
return save_ret;
|
|
2044
2045
|
} catch (err) {
|
|
2045
2046
|
return { code: -1, data: err.message };
|
|
2046
2047
|
}
|