@xuda.io/account_module 1.2.1401 → 1.2.1403
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 +18 -18
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1989,14 +1989,14 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1989
1989
|
if (account_code < 0) {
|
|
1990
1990
|
throw new Error(`account ${contact_uid} not found`);
|
|
1991
1991
|
}
|
|
1992
|
-
if (!account_info.profile_picture) {
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
}
|
|
1999
|
-
|
|
1992
|
+
// if (!account_info.profile_picture) {
|
|
1993
|
+
// account_info.profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
|
|
1994
|
+
// account_info.profile_picture = account_info.profile_picture_obj.file_url;
|
|
1995
|
+
// // account_info.profile_picture_obj = profile_picture_obj;
|
|
1996
|
+
// // account_info.profile_picture = profile_picture;
|
|
1997
|
+
// const account_save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
|
|
1998
|
+
// }
|
|
1999
|
+
set_account_profile_picture(uid, contact_uid);
|
|
2000
2000
|
const { bio, business_name, country, mainCategory, subCategory } = account_info;
|
|
2001
2001
|
} else {
|
|
2002
2002
|
// contact without use account
|
|
@@ -2065,22 +2065,22 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2065
2065
|
}
|
|
2066
2066
|
};
|
|
2067
2067
|
|
|
2068
|
-
const set_account_profile_picture = async function (uid,
|
|
2069
|
-
await update_profile_avatar_status(
|
|
2068
|
+
const set_account_profile_picture = async function (uid, account_uid) {
|
|
2069
|
+
await update_profile_avatar_status(account_uid, 1);
|
|
2070
2070
|
try {
|
|
2071
2071
|
let profile_picture;
|
|
2072
2072
|
|
|
2073
|
-
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts',
|
|
2073
|
+
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
|
|
2074
2074
|
let account_info = account_obj.account_info;
|
|
2075
2075
|
|
|
2076
2076
|
if (account_code < 0) {
|
|
2077
|
-
throw new Error(`account ${
|
|
2077
|
+
throw new Error(`account ${account_uid} not found`);
|
|
2078
2078
|
}
|
|
2079
|
-
await update_profile_avatar_status(
|
|
2079
|
+
await update_profile_avatar_status(account_uid, 2);
|
|
2080
2080
|
if (!account_info.profile_picture) {
|
|
2081
2081
|
const file_ret = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
|
|
2082
2082
|
|
|
2083
|
-
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts',
|
|
2083
|
+
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
|
|
2084
2084
|
let account_info = account_obj.account_info;
|
|
2085
2085
|
|
|
2086
2086
|
account_info.profile_picture_obj = file_ret.data;
|
|
@@ -2128,19 +2128,19 @@ const set_account_profile_picture = async function (uid, contact_uid) {
|
|
|
2128
2128
|
|
|
2129
2129
|
const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
|
|
2130
2130
|
|
|
2131
|
-
const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, account_info.account_type, 'account',
|
|
2131
|
+
const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, {}, business_size, name, account_info.email, job_id, headers);
|
|
2132
2132
|
|
|
2133
|
-
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts',
|
|
2133
|
+
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
|
|
2134
2134
|
let account_info = account_obj.account_info;
|
|
2135
2135
|
|
|
2136
2136
|
account_info.profile_avatar_obj = file_ret;
|
|
2137
2137
|
account_info.profile_avatar = account_info.profile_avatar_obj.file_url;
|
|
2138
2138
|
|
|
2139
2139
|
const account_save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
|
|
2140
|
-
await update_profile_avatar_status(
|
|
2140
|
+
await update_profile_avatar_status(account_uid, 3);
|
|
2141
2141
|
}
|
|
2142
2142
|
} catch (error) {
|
|
2143
|
-
await update_profile_avatar_status(
|
|
2143
|
+
await update_profile_avatar_status(account_uid, 3);
|
|
2144
2144
|
}
|
|
2145
2145
|
};
|
|
2146
2146
|
|