Circuits OK
Accounts Ok Movements OK
This commit is contained in:
@@ -39,7 +39,7 @@ const TypedError = require('../modules/ErrorHandler');
|
||||
const {MyGroup} = require('../models/mygroup');
|
||||
const {Circuit} = require('../models/circuit');
|
||||
|
||||
const mongoose = require('mongoose').set('debug', process.env.DEBUG);
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
|
||||
@@ -644,7 +644,7 @@ router.post('/circuits', authenticate, (req, res) => {
|
||||
idapp = req.body.idapp;
|
||||
locale = req.body.locale;
|
||||
|
||||
return Circuit.getCircuitsByUsername(idapp, username, req).then((ris) => {
|
||||
return Circuit.getCircuitsByUsername(idapp, username, req.user).then((ris) => {
|
||||
res.send(ris);
|
||||
}).catch((e) => {
|
||||
tools.mylog('ERRORE IN circuits: ' + e.message);
|
||||
@@ -731,11 +731,13 @@ router.post('/circuits/cmd', authenticate, async (req, res) => {
|
||||
}*/
|
||||
|
||||
return await User.setCircuitCmd(idapp, usernameOrig, circuitname, cmd, value, usernameLogged, extrarec).
|
||||
then((ris) => {
|
||||
then(async (ris) => {
|
||||
|
||||
// Check if ìs a Notif to read
|
||||
const idnotif = extrarec['idnotif'] ? extrarec['idnotif'] : '';
|
||||
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
|
||||
if (extrarec && extrarec.hasOwnProperty('idnotif')) {
|
||||
const idnotif = extrarec['idnotif'] ? extrarec['idnotif'] : '';
|
||||
await SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
|
||||
}
|
||||
|
||||
return res.send(ris);
|
||||
}).
|
||||
|
||||
Reference in New Issue
Block a user