la creazione dell'annuncio impiega troppo tempo (e le persone cliccavano su "Salva" più volte)...
This commit is contained in:
@@ -397,16 +397,21 @@ AccountSchema.statics.getUserAccounts = async function (idapp, username) {
|
||||
|
||||
if (ris) {
|
||||
for (const account of ris) {
|
||||
const pendingtransactions = await SendNotif.getSumPendingTransactions(idapp, username, account.circuit.name);
|
||||
const saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
account.saldo -= saldopending;
|
||||
account.totTransato = account.totTransato || 0;
|
||||
try {
|
||||
const pendingtransactions = await SendNotif.getSumPendingTransactions(idapp, username, account.circuit.name);
|
||||
const saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
account.saldo -= saldopending;
|
||||
account.totTransato = account.totTransato || 0;
|
||||
} catch (e) {
|
||||
console.error('getUserAccounts 1) ', e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ris;
|
||||
} catch (e) {
|
||||
console.error('e', e);
|
||||
console.error('getUserAccounts', e);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -516,7 +521,7 @@ AccountSchema.statics.SetMinMaxPersonali = async function (idapp, valmin, valmax
|
||||
const Account = this;
|
||||
|
||||
if (circuitId) {
|
||||
ris = await Account.updateMany({ idapp, circuitId, fidoConcesso: { $gt: 0 }, username: { "$nin": [null, ""] } },
|
||||
ris = await Account.updateMany({ idapp, circuitId, fidoConcesso: { $gt: 0 }, username: { "$nin": [null, ""] } },
|
||||
{
|
||||
$set:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user