@xuda.io/account_module 1.2.1095 → 1.2.1096
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 +7 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2475,6 +2475,11 @@ export const update_account_profile = async function (req, job_id, headers) {
|
|
|
2475
2475
|
const account_profile_properties = ['profile_name', 'profile_signature', 'profile_email', 'profile_picture', 'profile_avatar', 'profile_picture_obj', 'profile_avatar_obj', 'auto_respond', 'auto_respond_mode', 'auto_respond_agents'];
|
|
2476
2476
|
try {
|
|
2477
2477
|
let { data: account_profile_doc } = await db_module.get_couch_doc('xuda_accounts', _id);
|
|
2478
|
+
|
|
2479
|
+
if (account_profile_doc.docType !== 'account_profile') {
|
|
2480
|
+
throw new Error('not account profile doc');
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2478
2483
|
let changes_arr = [];
|
|
2479
2484
|
|
|
2480
2485
|
for (const key of account_profile_properties) {
|
|
@@ -2487,8 +2492,8 @@ export const update_account_profile = async function (req, job_id, headers) {
|
|
|
2487
2492
|
}
|
|
2488
2493
|
|
|
2489
2494
|
if (!changes_arr.length) {
|
|
2490
|
-
throw new Error('no change');
|
|
2491
|
-
|
|
2495
|
+
// throw new Error('no change');
|
|
2496
|
+
return { code: 56, data: 'no change' };
|
|
2492
2497
|
}
|
|
2493
2498
|
|
|
2494
2499
|
account_profile_doc.ts = Date.now();
|