@xuda.io/account_module 1.2.1381 → 1.2.1383
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 +6 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1980,19 +1980,20 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1980
1980
|
let profile_picture, profile_picture_obj;
|
|
1981
1981
|
let profile_avatar, profile_avatar_obj;
|
|
1982
1982
|
let account_info_ret;
|
|
1983
|
+
let account_info;
|
|
1983
1984
|
let account_type;
|
|
1984
1985
|
if (contact_uid) {
|
|
1985
1986
|
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
|
|
1986
|
-
|
|
1987
|
+
account_info = account_obj.account_info;
|
|
1987
1988
|
// account_info_ret = await get_account_name({ uid_query: contact_uid });
|
|
1988
1989
|
if (account_code < 0) {
|
|
1989
1990
|
throw new Error(`account ${contact_uid} not found`);
|
|
1990
1991
|
}
|
|
1991
|
-
if (!
|
|
1992
|
-
profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info
|
|
1992
|
+
if (!account_info.profile_picture) {
|
|
1993
|
+
profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
|
|
1993
1994
|
profile_picture = profile_picture_obj.url;
|
|
1994
|
-
|
|
1995
|
-
|
|
1995
|
+
account_info.profile_picture_obj = profile_picture_obj;
|
|
1996
|
+
account_info.profile_picture = profile_picture;
|
|
1996
1997
|
const account_save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
|
|
1997
1998
|
}
|
|
1998
1999
|
} else {
|