@xuda.io/account_module 1.2.1057 → 1.2.1059
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 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2612,13 +2612,13 @@ export const archive_account_profile = async function (req) {
|
|
|
2612
2612
|
export const delete_profile = async function (req, job_id, headers) {
|
|
2613
2613
|
const { profile_id } = req;
|
|
2614
2614
|
try {
|
|
2615
|
-
var contact_profile_doc = await db_module.get_couch_doc_native('
|
|
2615
|
+
var contact_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
|
|
2616
2616
|
|
|
2617
2617
|
contact_profile_doc.stat = 4;
|
|
2618
2618
|
contact_profile_doc.stat_ts = Date.now();
|
|
2619
2619
|
contact_profile_doc.stat_reason = 'deleted by the user';
|
|
2620
2620
|
|
|
2621
|
-
const contact_save_ret = await db_module.save_couch_doc('
|
|
2621
|
+
const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
|
|
2622
2622
|
|
|
2623
2623
|
ai_module.delete_depended_chats(uid, profile_id);
|
|
2624
2624
|
return contact_save_ret;
|
|
@@ -2633,7 +2633,7 @@ export const delete_profile = async function (req, job_id, headers) {
|
|
|
2633
2633
|
export const unarchive_profile = async function (req) {
|
|
2634
2634
|
const { profile_id } = req;
|
|
2635
2635
|
try {
|
|
2636
|
-
var contact_profile_doc = await db_module.get_couch_doc_native('
|
|
2636
|
+
var contact_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
|
|
2637
2637
|
|
|
2638
2638
|
if (contact_profile_doc.stat !== 5) {
|
|
2639
2639
|
throw new Error('contact is not archived');
|
|
@@ -2643,7 +2643,7 @@ export const unarchive_profile = async function (req) {
|
|
|
2643
2643
|
contact_profile_doc.stat_ts = Date.now();
|
|
2644
2644
|
contact_profile_doc.stat_reason = 'archived by the user';
|
|
2645
2645
|
|
|
2646
|
-
const contact_save_ret = await db_module.save_couch_doc('
|
|
2646
|
+
const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
|
|
2647
2647
|
|
|
2648
2648
|
return contact_save_ret;
|
|
2649
2649
|
} catch (err) {
|
|
@@ -2657,7 +2657,7 @@ export const unarchive_profile = async function (req) {
|
|
|
2657
2657
|
export const unfriend_profile = async function (req) {
|
|
2658
2658
|
const { profile_id } = req;
|
|
2659
2659
|
try {
|
|
2660
|
-
const contact_ret = await db_module.get_couch_doc('
|
|
2660
|
+
const contact_ret = await db_module.get_couch_doc('xuda_accounts', profile_id);
|
|
2661
2661
|
if (contact_ret.code < 0) {
|
|
2662
2662
|
throw new Error(contact_ret.data);
|
|
2663
2663
|
}
|
|
@@ -2672,7 +2672,7 @@ export const unfriend_profile = async function (req) {
|
|
|
2672
2672
|
await db_module.get_couch_doc_native('xuda_team', contact_profile_doc.team_req_id);
|
|
2673
2673
|
|
|
2674
2674
|
contact_profile_doc.team_req_id = null;
|
|
2675
|
-
const contact_save_ret = await db_module.save_couch_doc('
|
|
2675
|
+
const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
|
|
2676
2676
|
|
|
2677
2677
|
const req_save_ret = await db_module.save_couch_doc('xuda_team', req_doc);
|
|
2678
2678
|
|