@xuda.io/account_module 1.2.1073 → 1.2.1075
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 +33 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2470,6 +2470,38 @@ export const create_account_profile = async function (req, job_id, headers) {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
};
|
|
2472
2472
|
|
|
2473
|
+
export const update_account_profile = async function (req, job_id, headers) {
|
|
2474
|
+
const { uid, profile_name, profile_signature, profile_email, profile_picture, profile_avatar, profile_picture_obj, profile_avatar_obj } = req;
|
|
2475
|
+
try {
|
|
2476
|
+
// const app_id = await get_account_default_project_id(uid);
|
|
2477
|
+
const { data: acc_obj } = await db_module.get_couch_doc('xuda_accounts', uid);
|
|
2478
|
+
|
|
2479
|
+
const d = Date.now();
|
|
2480
|
+
const doc = {
|
|
2481
|
+
_id: await _common.xuda_get_uuid('contact_profile'),
|
|
2482
|
+
stat: 3,
|
|
2483
|
+
date_created_ts: d,
|
|
2484
|
+
ts: d,
|
|
2485
|
+
docType: 'account_profile',
|
|
2486
|
+
|
|
2487
|
+
uid,
|
|
2488
|
+
profile_name, //: profile_name || acc_obj.account_info.business_name || acc_obj.account_info.name,
|
|
2489
|
+
profile_signature,
|
|
2490
|
+
profile_email,
|
|
2491
|
+
profile_picture,
|
|
2492
|
+
profile_avatar,
|
|
2493
|
+
profile_picture_obj,
|
|
2494
|
+
profile_avatar_obj,
|
|
2495
|
+
};
|
|
2496
|
+
const save_ret = await db_module.save_couch_doc('xuda_accounts', doc);
|
|
2497
|
+
// acc_obj.active_profile_id = save_ret.data.id;
|
|
2498
|
+
|
|
2499
|
+
return { code: 55, data: save_ret };
|
|
2500
|
+
} catch (err) {
|
|
2501
|
+
return { code: -55, data: err.message };
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
|
|
2473
2505
|
setTimeout(async () => {
|
|
2474
2506
|
const app_id = 'prj712ffdf5aa8adce6cedef988f9c12392'; //'prj3937cb6f9a31c8c7dea25055bba845b1'; //
|
|
2475
2507
|
const uid = 'd39126e0e2c51ffbd1aad10709fc8335';
|
|
@@ -2552,7 +2584,7 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
|
|
|
2552
2584
|
|
|
2553
2585
|
doc.avatar_source = account_info_ret.data.avatar_source;
|
|
2554
2586
|
doc.icon_pattern = await get_pattern(doc);
|
|
2555
|
-
|
|
2587
|
+
doc.name = doc.profile_name;
|
|
2556
2588
|
doc.interactions = 0;
|
|
2557
2589
|
doc.chats = 0;
|
|
2558
2590
|
|