@xuda.io/account_module 1.2.1074 → 1.2.1076

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.
Files changed (2) hide show
  1. package/index.mjs +31 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2470,6 +2470,37 @@ 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 { data: acc_obj } = await db_module.get_couch_doc('xuda_accounts', uid);
2477
+
2478
+ const d = Date.now();
2479
+ const doc = {
2480
+ _id: await _common.xuda_get_uuid('contact_profile'),
2481
+ stat: 3,
2482
+ date_created_ts: d,
2483
+ ts: d,
2484
+ docType: 'account_profile',
2485
+
2486
+ uid,
2487
+ profile_name, //: profile_name || acc_obj.account_info.business_name || acc_obj.account_info.name,
2488
+ profile_signature,
2489
+ profile_email,
2490
+ profile_picture,
2491
+ profile_avatar,
2492
+ profile_picture_obj,
2493
+ profile_avatar_obj,
2494
+ };
2495
+ const save_ret = await db_module.save_couch_doc('xuda_accounts', doc);
2496
+ // acc_obj.active_profile_id = save_ret.data.id;
2497
+
2498
+ return { code: 55, data: save_ret };
2499
+ } catch (err) {
2500
+ return { code: -55, data: err.message };
2501
+ }
2502
+ };
2503
+
2473
2504
  setTimeout(async () => {
2474
2505
  const app_id = 'prj712ffdf5aa8adce6cedef988f9c12392'; //'prj3937cb6f9a31c8c7dea25055bba845b1'; //
2475
2506
  const uid = 'd39126e0e2c51ffbd1aad10709fc8335';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1074",
3
+ "version": "1.2.1076",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {