fix Saldo when press refuse coins.

fix Risolvere problema del ritardo quando si fa il primo login...
This commit is contained in:
Paolo Arena
2022-09-16 17:38:49 +02:00
parent 9f34a6b916
commit 671a39e51c
11 changed files with 162 additions and 62 deletions

View File

@@ -387,11 +387,12 @@ router.post('/profile', authenticate, (req, res) => {
//++Todo: controlla che tipo di dati ha il permesso di leggere
// Check if ìs a Notif to read
const idnotif = req.body['idnotif'] ? req.body['idnotif'] : '';
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
try {
// Check if ìs a Notif to read
const idnotif = req.body['idnotif'] ? req.body['idnotif'] : '';
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
return User.getUserProfileByUsername(idapp, username, req.user.username,
false, req.user.perm).
then((ris) => {
@@ -444,7 +445,7 @@ router.post('/panel', authenticate, async (req, res) => {
if (!!myuser) {
res.send(myuser);
} else {
tools.mylog('ERRORE IN panel: ' + e.message);
tools.mylog('ERRORE IN panel: ');
res.status(400).send();
}
} catch (e) {
@@ -455,7 +456,7 @@ router.post('/panel', authenticate, async (req, res) => {
});
router.post('/notifs', authenticate, async (req, res) => {
const notifs = req.body['notifs'];
/* const notifs = req.body['notifs'];
idapp = req.body.idapp;
locale = req.body.locale;
@@ -479,6 +480,8 @@ router.post('/notifs', authenticate, async (req, res) => {
res.status(400).send();
}
*/
});
router.post('/login', (req, res) => {
@@ -559,7 +562,7 @@ router.post('/login', (req, res) => {
// console.log('res', myris.token, myris.usertosend);
// SEND TOKEN AND CODE RESULT
res.header('x-auth', myris.token).send({
return res.header('x-auth', myris.token).send({
usertosend: myris.usertosend,
code: server_constants.RIS_CODE_OK,
subsExistonDb: myris.subsExistonDb,