fix Conti Collettivi + messaggi

This commit is contained in:
Surya Paolo
2023-02-02 13:53:09 +01:00
parent f79c3b1d77
commit 0234e2323a
16 changed files with 140 additions and 88 deletions

View File

@@ -254,8 +254,15 @@ export const useUserStore = defineStore('UserStore', {
}
},
GroupsListWhereIAmAdmin(circuitname: string): any {
console.log('GL', circuitname)
GroupsListWhereIAmAdmin(): any {
try {
return this.my.profile.manage_mygroups
} catch (e) {
return []
}
},
GroupsListWhereIAmAdminInTheCircuit(circuitname: string): any {
try {
const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.findIndex((circ: IMyCircuit) => circ.circuitname === circuitname) >= 0))
console.log('arr', arr)
@@ -265,6 +272,15 @@ export const useUserStore = defineStore('UserStore', {
}
},
hoContiComunitariDaAmministrare(): boolean {
try {
const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.length > 0))
return !!arr
} catch (e) {
return false
}
},
hoContiCollettiviDaAmministrare(): boolean {
const arr = this.my.profile.manage_mygroups.find((group: IMyGroup) => group.account)
return arr ? true : false