- Accepted and Refused Group Entering

- Report a User
This commit is contained in:
paoloar77
2022-08-04 17:30:57 +02:00
parent d902783336
commit 8a587dc715
16 changed files with 529 additions and 266 deletions

View File

@@ -78,6 +78,7 @@ const UserCost = {
'profile.teleg_id',
'profile.manage_telegram',
'deleted',
'reported',
],
FIELDS_REQUISITI: [
@@ -247,6 +248,11 @@ router.post('/settable', authenticate, async (req, res) => {
mydata.userId = req.user._id;
}
if (shared_consts.TABLES_CREATEDBY.includes(params.table)) {
if (!mydata.createdBy)
mydata.createdBy = req.user.username;
}
if (shared_consts.TABLES_PERM_NEWREC.includes(params.table)) {
if (!consentito) {
mydata.verifyrec = false;
@@ -332,7 +338,7 @@ router.post('/settable', authenticate, async (req, res) => {
let setnotif = false;
let typedir = 0;
let typeid = 0;
let groupNameDest = '';
let groupnameDest = '';
if (shared_consts.TABLES_ADV_NOTIFICATION.includes(params.table)) {
typedir = shared_consts.TypeNotifs.TYPEDIR_BACHECA;
@@ -349,12 +355,12 @@ router.post('/settable', authenticate, async (req, res) => {
if (shared_consts.TABLES_GROUPS_NOTIFICATION.includes(params.table)) {
typedir = shared_consts.TypeNotifs.TYPEDIR_GROUPS;
typeid = shared_consts.TypeNotifs.ID_GROUP_NEW_REC;
groupNameDest = myrec ? myrec.groupname : '';
groupnameDest = myrec ? myrec.groupname : '';
setnotif = true;
}
if (setnotif) {
await SendNotif.createNewNotification(req, res, {groupNameDest}, params.table, myrec, typedir, typeid);
await SendNotif.createNewNotification(req, res, {groupnameDest}, params.table, myrec, typedir, typeid);
}
if (params.table === shared_consts.TAB_MYGROUPS && isnewrec) {
@@ -502,6 +508,7 @@ router.post('/getexp', authenticate, (req, res) => {
{
username: 1,
email: 1,
'reported': 1,
'profile.teleg_id': 1,
'verified_by_aportador': 1,
'profile.username_telegram': 1,