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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user