l'admin non riesce a cambiare il fido degli utenti...
This commit is contained in:
@@ -488,6 +488,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
getMyCircuitsInCommonByUser(user: IUserFields): any[] {
|
||||
let arrout = []
|
||||
let arrfinale = []
|
||||
let vuoto = false
|
||||
|
||||
const circuitStore = useCircuitStore()
|
||||
@@ -497,21 +498,30 @@ export const useUserStore = defineStore('UserStore', {
|
||||
else
|
||||
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
|
||||
|
||||
// se non ho neanche 1 circuito in comune, metto il mio preferito
|
||||
if (arrout.length <= 0) {
|
||||
const circuit = circuitStore.getCircuitByProvince(this.my.profile.resid_province)
|
||||
if (circuit)
|
||||
arrout.push(circuit.name)
|
||||
else {
|
||||
if (this.my.profile.mycircuits.length > 0) {
|
||||
arrout.push(this.my.profile.mycircuits[0].circuitname)
|
||||
}
|
||||
// controlla che il circuito sia Abilitato!
|
||||
for (const circuitname of arrout) {
|
||||
const circuit = circuitStore.getCircuitByName(circuitname)
|
||||
if (circuit && circuit.transactionsEnabled) {
|
||||
arrfinale.push(circuitname)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('arrout', arrout)
|
||||
// se non ho neanche 1 circuito in comune, metto il mio preferito
|
||||
if (arrfinale.length <= 0) {
|
||||
const circuit = circuitStore.getCircuitByProvince(this.my.profile.resid_province)
|
||||
if (circuit)
|
||||
arrfinale.push(circuit.name)
|
||||
else {
|
||||
if (this.my.profile.mycircuits.length > 0) {
|
||||
arrfinale.push(this.my.profile.mycircuits[0].circuitname)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
return arrout
|
||||
console.log('arrout', arrfinale)
|
||||
|
||||
return arrfinale
|
||||
},
|
||||
|
||||
getMyCircuits(): any[] {
|
||||
|
||||
Reference in New Issue
Block a user