vedere le Richieste di Fiducia solo se si è verificati Telegram
Corretto il mio account che doveva confermare in automatico... non lo faceva...
This commit is contained in:
@@ -549,10 +549,12 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
Object.keys(fieldsvalue)[0]);
|
||||
|
||||
let allData = {};
|
||||
let username = '';
|
||||
if (mydata.table === 'users') {
|
||||
if (camporequisiti) {
|
||||
allData = {};
|
||||
allData.myuser = await User.getUserById(idapp, id);
|
||||
username = allData.myuser.username;
|
||||
if (!!allData.myuser)
|
||||
allData.precDataUser = await User.getInfoUser(idapp,
|
||||
allData.myuser.username);
|
||||
@@ -595,7 +597,7 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
|
||||
const updatebot = UserCost.FIELDS_UPDATE_TELEGRAM_BOT.includes(Object.keys(fieldsvalue)[0]);
|
||||
|
||||
tools.refreshAllTablesInMem(idapp, mydata.table, updatebot);
|
||||
tools.refreshAllTablesInMem(idapp, mydata.table, updatebot, username);
|
||||
|
||||
if (mydata.table === shared_consts.TAB_SETTINGS) {
|
||||
if (shared_consts.KEY_TO_CRYPTED.includes(fieldsvalue.key)) {
|
||||
@@ -906,18 +908,20 @@ router.delete('/delrec/:table/:id', authenticate, async (req, res) => {
|
||||
let ris = null;
|
||||
|
||||
if (!cancellato) {
|
||||
// ELIMINA VERAMENTE IL RECORD !!!
|
||||
ris = await mytable.findByIdAndRemove(id).then((rec) => {
|
||||
if (!rec) {
|
||||
// res.status(404).send();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (tablename === shared_consts.TAB_MYGROUPS) {
|
||||
// Se è un gruppo, allora cancella anche tutti i suoi riferimenti
|
||||
User.removeAllUsersFromMyGroups(rec.idapp, rec.groupname);
|
||||
}
|
||||
|
||||
tools.refreshAllTablesInMem(rec.idapp, tablename, true, rec.username);
|
||||
|
||||
cancellato = true;
|
||||
|
||||
tools.mylog('DELETED ', rec._id);
|
||||
|
||||
Reference in New Issue
Block a user