@xuda.io/account_module 1.2.473 → 1.2.475
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 +7 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1379,7 +1379,7 @@ export const archive_contact = async function (req) {
|
|
|
1379
1379
|
|
|
1380
1380
|
export const add_contact = async function (req, job_id, headers) {
|
|
1381
1381
|
try {
|
|
1382
|
-
const { uid, email, name, stat, contact_uid, context, source, team_req_id } = req;
|
|
1382
|
+
const { uid, email, name, stat, contact_uid, context, source, team_req_id, data } = req;
|
|
1383
1383
|
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: [uid, email] });
|
|
1384
1384
|
|
|
1385
1385
|
if (contact_ret.rows.length) {
|
|
@@ -1407,13 +1407,18 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1407
1407
|
headers,
|
|
1408
1408
|
source,
|
|
1409
1409
|
team_req_id,
|
|
1410
|
+
data,
|
|
1410
1411
|
};
|
|
1411
1412
|
const ret = await db_module.save_couch_doc('xuda_contacts', doc);
|
|
1412
1413
|
|
|
1413
1414
|
if (!account_ret?.data?.profile_avatar) {
|
|
1414
1415
|
const app_id = await get_account_default_project_id(uid);
|
|
1415
1416
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
1416
|
-
|
|
1417
|
+
if (account_ret?.data?.profile_avatar) {
|
|
1418
|
+
} else {
|
|
1419
|
+
// create factual avatar
|
|
1420
|
+
ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers, 'xuda_contacts', [email, doc._id, 'contact', app_id]);
|
|
1421
|
+
}
|
|
1417
1422
|
}
|
|
1418
1423
|
return ret;
|
|
1419
1424
|
} catch (err) {
|