@xuda.io/account_module 1.2.763 → 1.2.765
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 +11 -10
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -175,15 +175,6 @@ export const update_account_info = async function (req, job_id, headers) {
|
|
|
175
175
|
// }
|
|
176
176
|
// }
|
|
177
177
|
|
|
178
|
-
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
179
|
-
if (account_obj.account_info?.profile_picture) {
|
|
180
|
-
if (!account_obj.account_info?.profile_avatar) {
|
|
181
|
-
ai_module.convert_profile_image_to_avatar({ url: account_obj.account_info?.profile_picture, uid, account_obj }, job_id, headers);
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
ai_module.update_thumbnail('account', account_obj, account_obj.account_project_id, uid, job_id, headers, 'xuda_accounts');
|
|
185
|
-
}
|
|
186
|
-
|
|
187
178
|
// temp remove later on
|
|
188
179
|
|
|
189
180
|
// let drive_req = { app_id: account_obj.account_project_id, uid, path: '/' };
|
|
@@ -196,6 +187,15 @@ export const update_account_info = async function (req, job_id, headers) {
|
|
|
196
187
|
|
|
197
188
|
const ret2 = await db_module.save_couch_doc('xuda_accounts', account_obj);
|
|
198
189
|
|
|
190
|
+
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
191
|
+
if (account_obj.account_info?.profile_picture) {
|
|
192
|
+
if (!account_obj.account_info?.profile_avatar) {
|
|
193
|
+
ai_module.convert_profile_image_to_avatar({ url: account_obj.account_info?.profile_picture, uid, account_obj }, job_id, headers);
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
ai_module.update_thumbnail('account', account_obj, account_obj.account_project_id, uid, job_id, headers, 'xuda_accounts');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
199
|
// update_contacts_with_account_changes(account_obj._id, account_info_changes_arr);
|
|
200
200
|
|
|
201
201
|
if (ret2.code > 0) {
|
|
@@ -1348,6 +1348,7 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1348
1348
|
|
|
1349
1349
|
//membership_plan
|
|
1350
1350
|
doc.name = `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
1351
|
+
doc.name = account_info_ret.data?.account_type === 'business' ? account_info_ret.data.business_name : `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
1351
1352
|
|
|
1352
1353
|
if (account_info_ret.data.phone_number) {
|
|
1353
1354
|
try {
|
|
@@ -1486,7 +1487,7 @@ const get_user_contact = async function (uid, uid_query) {
|
|
|
1486
1487
|
const account_info = (await get_account_name({ uid_query })).data;
|
|
1487
1488
|
let doc = { docType: 'contact', account_type: account_info.account_type, date_created: Date.now(), email: account_info.email, my_contact: uid === uid_query, contact_uid: uid_query };
|
|
1488
1489
|
|
|
1489
|
-
doc.name = account_info?.account_type === 'business' ?
|
|
1490
|
+
doc.name = account_info?.account_type === 'business' ? account_info.business_name : `${account_info.first_name} ${account_info.last_name}`;
|
|
1490
1491
|
doc.profile_avatar = account_info.profile_avatar;
|
|
1491
1492
|
doc.profile_picture = account_info.profile_picture;
|
|
1492
1493
|
doc.card_background = get_contact_background(doc);
|