Aggiungere Sito internet anche ai gruppi

Pare che quando creo un gruppo compaia il mio username tra gli amministratori !
Il filtro per Categoria in Servizi non filtra bene !
This commit is contained in:
paoloar77
2022-02-28 00:07:47 +01:00
parent 8d98726f1f
commit 12d2eff24a
5 changed files with 12 additions and 16 deletions

View File

@@ -281,21 +281,14 @@ router.post('/settable', authenticate, (req, res) => {
if (shared_consts.TABLES_USER_INCLUDE_MY.includes(params.table)) {
if (!mydata.admins) {
// Aggiungi solo se non esistono Admin:
mydata.admins = [];
} else {
/*const arrnew = [];
for (const username of mydata.admins) {
arrnew.push({username});
const indfind = mydata.admins.findIndex(
(rec) => (rec.username === req.user.username));
if (indfind < 0) {
mydata.admins.push({username: req.user.username});
}
mydata.admins = arrnew;
*/
}
const indfind = mydata.admins.findIndex(
(rec) => (rec.username === req.user.username));
if (indfind < 0) {
mydata.admins.push({username: req.user.username});
}
}
@@ -584,6 +577,7 @@ router.patch('/chval', authenticate, async (req, res) => {
}
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).then(async (rec) => {
// tools.mylogshow(' REC TO MODIFY: ', rec);
if (!rec) {