@xuda.io/account_module 1.2.1811 → 1.2.1812
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 +8 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2316,10 +2316,17 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2316
2316
|
}
|
|
2317
2317
|
}
|
|
2318
2318
|
let file_ret = { code: 1, data: cache };
|
|
2319
|
-
|
|
2319
|
+
|
|
2320
2320
|
if (!cache) {
|
|
2321
2321
|
// if personal, return profile pic, if business return logo
|
|
2322
2322
|
file_ret = await ai_module.get_profile_picture(uid, contact_obj.account_type, contact_obj?.business_info?.business_domain || contact_obj.name, { email: contact_obj.email, metadata: contact_obj }, account_profile_info, job_id, headers);
|
|
2323
|
+
|
|
2324
|
+
if (file_ret.code < 0) {
|
|
2325
|
+
throw new Error(file_ret.data);
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
if (!_.isObject(file_ret.data)) throw new Error('file_ret not an object');
|
|
2329
|
+
|
|
2323
2330
|
if (contact_obj?.business_info?.business_domain) {
|
|
2324
2331
|
if (!identifyPersonalProvider(contact_obj.business_info.business_domain)) {
|
|
2325
2332
|
save_xuda_cache(uid, 'profile_picture', contact_obj.business_info.business_domain, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
@@ -2329,11 +2336,6 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2329
2336
|
}
|
|
2330
2337
|
save_xuda_cache(uid, 'profile_picture', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
2331
2338
|
}
|
|
2332
|
-
if (file_ret.code < 0) {
|
|
2333
|
-
throw new Error(file_ret.data);
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
if (!_.isObject(file_ret.data)) throw new Error('file_ret not an object');
|
|
2337
2339
|
|
|
2338
2340
|
let { code: contact_code, data: contact_obj2 } = await db_module.get_app_couch_doc(account_profile_info.app_id, contact_id);
|
|
2339
2341
|
contact_obj = contact_obj2;
|