@xuda.io/account_module 1.2.1419 → 1.2.1421
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 +13 -12
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2165,15 +2165,17 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2165
2165
|
|
|
2166
2166
|
let { code: contact_code, data: contact_obj } = await db_module.get_app_couch_doc(account_profile_info.app_id, contact_id);
|
|
2167
2167
|
|
|
2168
|
-
|
|
2168
|
+
contact_obj.profile_picture_obj = file_ret.data;
|
|
2169
2169
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2170
|
+
contact_obj.profile_picture = contact_obj.profile_picture_obj.file_url;
|
|
2171
|
+
contact_obj.profile_picture_source = file_ret.profile_picture_source;
|
|
2172
2172
|
const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
|
|
2173
|
-
profile_picture =
|
|
2173
|
+
profile_picture = contact_obj.profile_picture;
|
|
2174
2174
|
}
|
|
2175
2175
|
|
|
2176
|
-
|
|
2176
|
+
// get business info
|
|
2177
|
+
|
|
2178
|
+
if (!contact_obj.profile_avatar) {
|
|
2177
2179
|
let business_size;
|
|
2178
2180
|
|
|
2179
2181
|
switch (account_obj.membership_plan) {
|
|
@@ -2208,16 +2210,15 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2208
2210
|
break;
|
|
2209
2211
|
}
|
|
2210
2212
|
|
|
2211
|
-
const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
|
|
2212
|
-
const { bio, country, mainCategory, subCategory } = account_info;
|
|
2213
|
+
// const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
|
|
2214
|
+
// const { bio, country, mainCategory, subCategory } = account_info;
|
|
2213
2215
|
|
|
2214
|
-
const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info,
|
|
2216
|
+
const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, contact_obj.account_type, 'contact', contact_id, { bio, country, mainCategory, subCategory }, business_size, contact_obj.name, contact_obj.email, job_id, headers);
|
|
2215
2217
|
|
|
2216
|
-
let { code:
|
|
2217
|
-
let account_info = account_obj.account_info;
|
|
2218
|
+
let { code: contact_code, data: contact_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
|
|
2218
2219
|
|
|
2219
|
-
|
|
2220
|
-
|
|
2220
|
+
contact_obj.profile_avatar_obj = file_ret;
|
|
2221
|
+
contact_obj.profile_avatar = contact_obj.profile_avatar_obj.file_url;
|
|
2221
2222
|
|
|
2222
2223
|
const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
|
|
2223
2224
|
await update_contact_profile_picture_status(uid, contact_id, 3);
|