- Entri in Circuito Italia solo se hai il fido nel circuito provinciale
- Aggiunta Zona, oltre alla provincia, per visualizzare i vari circuiti della prov
This commit is contained in:
@@ -725,9 +725,8 @@ AccountSchema.statics.removeAdminOfAccount = async function (idapp, username, ci
|
||||
|
||||
// Rimuovi l'account
|
||||
AccountSchema.statics.removeAccount = async function (accountId) {
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
return await Circuit.deleteOne({ _id: accountId});
|
||||
return await Account.deleteOne({ _id: accountId});
|
||||
};
|
||||
|
||||
AccountSchema.statics.updateSaldoAndTransato_AllAccounts = async function (idapp) {
|
||||
|
||||
@@ -1110,7 +1110,7 @@ CircuitSchema.statics.getListCircuitsByUsername = async function (idapp, usernam
|
||||
if (account.groupname === '') {
|
||||
mystr += '\n👉🏻 ' + account.circuit.name + '\n';
|
||||
mystr += ' [Saldo: ' + account.saldo + ' RIS, ';
|
||||
mystr += ' Fido: ' + account.fidoConcesso + ' RIS, ';
|
||||
mystr += ' Fiducia: ' + account.fidoConcesso + ' RIS, ';
|
||||
mystr += ' Transato: ' + account.totTransato + ' RIS]';
|
||||
}
|
||||
}
|
||||
@@ -1121,7 +1121,7 @@ CircuitSchema.statics.getListCircuitsByUsername = async function (idapp, usernam
|
||||
if (myuser.profile.mycircuits.find((rec) => (rec.circuitname === account.circuit.name))) {
|
||||
mystr += '\n GRUPPO: 👉🏻 <b>' + account.groupname + '</b> in ' + account.circuit.name + '\n';
|
||||
mystr += ' [Saldo: ' + account.saldo + ' RIS, ';
|
||||
mystr += ' Fido: ' + account.fidoConcesso + ' RIS, ';
|
||||
mystr += ' Fiducia: ' + account.fidoConcesso + ' RIS, ';
|
||||
mystr += ' Transato: ' + account.totTransato + ' RIS]';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,9 +507,26 @@ MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, ci
|
||||
|
||||
// Rimuovo il Circuito all'interno del Gruppo
|
||||
MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
||||
return await this.updateOne({ idapp, groupname },
|
||||
|
||||
|
||||
const ris = await this.updateOne({ idapp, groupname },
|
||||
{ $pull: { 'mycircuits': { circuitname: { $in: [circuitname] } } } });
|
||||
|
||||
const circuitId = await Circuit.getCircuitIdByName(idapp, circuitname);
|
||||
let remove = false;
|
||||
|
||||
// Se il mio account non è stato utilizzato, allora lo cancello anche questo
|
||||
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, false, groupname, '');
|
||||
if (myaccount && myaccount.totTransato === 0) {
|
||||
remove = true;
|
||||
} else {
|
||||
remove = true;
|
||||
}
|
||||
|
||||
if (remove) {
|
||||
await Account.removeAccount(myaccount._id);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
||||
|
||||
@@ -2085,8 +2085,8 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
||||
|
||||
if (value) {
|
||||
// Aggiungi alle amicizie
|
||||
await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
|
||||
shared_consts.FRIENDSCMD.SETFRIEND, value);
|
||||
// await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
|
||||
// shared_consts.FRIENDSCMD.SETFRIEND, value);
|
||||
|
||||
msgOrig = i18n.__({ phrase: '✅ Hai Abilitato l\'accesso alla App a %s !', locale: userDest.lang }, userDest.username);
|
||||
msgDest = i18n.__({ phrase: '✅ Sei stato Abilitato correttamente da %s!', locale: lang }, usernameOrig);
|
||||
|
||||
Reference in New Issue
Block a user