@xuda.io/account_module 1.2.383 → 1.2.385
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 +31 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1204,18 +1204,17 @@ export const get_contacts = async function (req) {
|
|
|
1204
1204
|
let requests_to = { docs: [] };
|
|
1205
1205
|
|
|
1206
1206
|
if (with_requests) {
|
|
1207
|
-
requests_from = await db_module.find_couch_query('xuda_team', { selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid }, fields: ['_id', 'team_req_date', 'team_req_to_email', 'team_req_from_uid'] });
|
|
1208
1207
|
requests_to = await db_module.find_couch_query('xuda_team', {
|
|
1209
|
-
selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2,
|
|
1208
|
+
selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid },
|
|
1210
1209
|
fields: ['_id', 'team_req_date', 'team_req_to_uid', 'team_req_to_email', 'sender_account_info.email', 'sender_account_info.first_name', 'sender_account_info.last_name', 'sender_account_info.profile_avatar', 'team_req_from_uid'],
|
|
1211
1210
|
});
|
|
1211
|
+
// requests_from = await db_module.find_couch_query('xuda_team', { selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid }, fields: ['_id', 'team_req_date', 'team_req_to_email', 'team_req_from_uid'] });
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
1214
|
return {
|
|
1215
1215
|
code: 1,
|
|
1216
1216
|
data: {
|
|
1217
1217
|
docs: [
|
|
1218
|
-
...requests_from.docs.map((e) => ({ docType: 'contact', date_created: e.team_req_date, email: [e.team_req_to_email], name: '', profile_avatar: _conf.anonymous_image_url, pending: true, uid: e.team_req_from_uid, team_req_id: e._id })),
|
|
1219
1218
|
...requests_to.docs.map((e) => ({
|
|
1220
1219
|
docType: 'contact',
|
|
1221
1220
|
date_created: e.team_req_date,
|
|
@@ -1226,10 +1225,39 @@ export const get_contacts = async function (req) {
|
|
|
1226
1225
|
team_req_from_uid: e.team_req_from_uid,
|
|
1227
1226
|
team_req_id: e._id,
|
|
1228
1227
|
})),
|
|
1228
|
+
...requests_from.docs.map((e) => ({ docType: 'contact', date_created: e.team_req_date, email: [e.team_req_to_email], name: '', profile_avatar: _conf.anonymous_image_url, pending: true, uid: e.team_req_from_uid, team_req_id: e._id })),
|
|
1229
1229
|
...contacts.docs,
|
|
1230
1230
|
],
|
|
1231
1231
|
},
|
|
1232
1232
|
};
|
|
1233
|
+
|
|
1234
|
+
// if (with_requests) {
|
|
1235
|
+
// requests_from = await db_module.find_couch_query('xuda_team', { selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid }, fields: ['_id', 'team_req_date', 'team_req_to_email', 'team_req_from_uid'] });
|
|
1236
|
+
// requests_to = await db_module.find_couch_query('xuda_team', {
|
|
1237
|
+
// selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_to_uid: uid },
|
|
1238
|
+
// fields: ['_id', 'team_req_date', 'team_req_to_uid', 'team_req_to_email', 'sender_account_info.email', 'sender_account_info.first_name', 'sender_account_info.last_name', 'sender_account_info.profile_avatar', 'team_req_from_uid'],
|
|
1239
|
+
// });
|
|
1240
|
+
// }
|
|
1241
|
+
|
|
1242
|
+
// return {
|
|
1243
|
+
// code: 1,
|
|
1244
|
+
// data: {
|
|
1245
|
+
// docs: [
|
|
1246
|
+
// ...requests_from.docs.map((e) => ({ docType: 'contact', date_created: e.team_req_date, email: [e.team_req_to_email], name: '', profile_avatar: _conf.anonymous_image_url, pending: true, uid: e.team_req_from_uid, team_req_id: e._id })),
|
|
1247
|
+
// ...requests_to.docs.map((e) => ({
|
|
1248
|
+
// docType: 'contact',
|
|
1249
|
+
// date_created: e.team_req_date,
|
|
1250
|
+
// email: [e.sender_account_info.email],
|
|
1251
|
+
// name: `${e.sender_account_info.first_name} ${e.sender_account_info.last_name}`,
|
|
1252
|
+
// profile_avatar: e.sender_account_info.profile_avatar || _conf.anonymous_image_url,
|
|
1253
|
+
// pending: true,
|
|
1254
|
+
// team_req_from_uid: e.team_req_from_uid,
|
|
1255
|
+
// team_req_id: e._id,
|
|
1256
|
+
// })),
|
|
1257
|
+
// ...contacts.docs,
|
|
1258
|
+
// ],
|
|
1259
|
+
// },
|
|
1260
|
+
// };
|
|
1233
1261
|
};
|
|
1234
1262
|
|
|
1235
1263
|
export const archive_contact = async function (req) {
|