diff --git a/src/server/router/circuits_router.js b/src/server/router/circuits_router.js index b062c79..db5e8b2 100755 --- a/src/server/router/circuits_router.js +++ b/src/server/router/circuits_router.js @@ -41,6 +41,7 @@ router.post('/load', authenticate, async (req, res) => { // Check if ìs a Notif to read const idnotif = req.body['idnotif'] ? req.body['idnotif'] : ''; + const lastdr = req.body['lastdr'] ? req.body['lastdr'] : ''; SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif); const whatshow = Circuit.getWhatToShow(idapp, req.user.username); @@ -75,7 +76,10 @@ router.post('/load', authenticate, async (req, res) => { data.account = await Account.getAccountByUsernameAndCircuitId(idapp, '', data._id, false, '', data.path); } - res.send({ circuit: data, users_in_circuit }); + const arrrecnotif = await SendNotif.findAllNotifByUsernameIdAndIdApp(req.user.username, lastdr, idapp); + const useraccounts = await Account.getUserAccounts(idapp, req.user.username); + + res.send({ circuit: data, users_in_circuit, arrrecnotif, useraccounts }); } catch (e) { console.error('Error in Circuits', e);