fix: non riuscivi ad acquistare i RIS al gruppo
- lista linkREG
This commit is contained in:
@@ -86,6 +86,7 @@ export const DefaultUser: IUserFields = {
|
||||
mygroups: [],
|
||||
mycircuits: [],
|
||||
last_circuitpath: '',
|
||||
lastdate_LinkReg: tools.getLastDateReadReset(),
|
||||
lastdate_reqRis: tools.getLastDateReadReset(),
|
||||
manage_mygroups: [],
|
||||
userstoverify: [],
|
||||
@@ -550,20 +551,10 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
getMyCircuitsInCommonByUser(user: IUserFields): any[] {
|
||||
let arrout = []
|
||||
addarrfinale(arrout: any): any[] {
|
||||
let arrfinale = []
|
||||
let vuoto = false
|
||||
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
if (!this.my.profile.mycircuits || (!user || !user.profile || !user.profile.mycircuits))
|
||||
vuoto = true // ok
|
||||
else
|
||||
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
|
||||
|
||||
|
||||
|
||||
// controlla che il circuito sia Abilitato e Territoriale !
|
||||
for (const circuitname of arrout) {
|
||||
const circuit = circuitStore.getCircuitByName(circuitname)
|
||||
@@ -580,22 +571,30 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
} */
|
||||
|
||||
// console.log('arrout', arrfinale)
|
||||
|
||||
return arrfinale
|
||||
|
||||
},
|
||||
|
||||
getMyCircuitsInCommonByUser(user: IUserFields): any[] {
|
||||
let arrout = []
|
||||
let vuoto = false
|
||||
|
||||
if (!this.my.profile.mycircuits || (!user || !user.profile || !user.profile.mycircuits))
|
||||
vuoto = true // ok
|
||||
else
|
||||
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname', 'circuitname')
|
||||
|
||||
return this.addarrfinale(arrout)
|
||||
},
|
||||
|
||||
getMyCircuitsInCommonByGroup(group: IMyGroup): any[] {
|
||||
console.log('this.my.profile.mycircuits', this.my.profile.mycircuits)
|
||||
|
||||
if (!this.my.profile.mycircuits || (!group || !group.mycircuits))
|
||||
return []
|
||||
const arrout = tools.getCommon([...this.my.profile.mycircuits], [...group.mycircuits], 'circuitname', 'name')
|
||||
|
||||
return this.addarrfinale(arrout)
|
||||
},
|
||||
|
||||
getMyCircuits(): any[] {
|
||||
@@ -605,12 +604,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return this.my.profile.mycircuits.map(item => item.circuitname)
|
||||
},
|
||||
|
||||
getMyCircuitsInCommonByGroup(group: IMyGroup): any[] {
|
||||
|
||||
if (!this.my.profile.mycircuits || (!group || !group.mycircuits))
|
||||
return []
|
||||
return tools.getCommon([...this.my.profile.mycircuits], [...group.mycircuits], 'circuitname')
|
||||
},
|
||||
|
||||
getMyHandshakeInCommon(myuser: IUserFields): any[] {
|
||||
|
||||
@@ -1727,6 +1720,21 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
async seListLinkReg(username: string, groupname: string) {
|
||||
const data = {
|
||||
username,
|
||||
groupname,
|
||||
}
|
||||
|
||||
return Api.SendReq('/users/listlinkreg', 'POST', data)
|
||||
.then((ris) => {
|
||||
console.log('out:', ris)
|
||||
return ris.data
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
async loadGroup(groupname: string, idnotif: string) {
|
||||
|
||||
Reference in New Issue
Block a user