Conto Comunitario...

This commit is contained in:
Surya Paolo
2023-01-12 01:03:19 +01:00
parent 2acf161d5d
commit 3d77cf671d
21 changed files with 436 additions and 65 deletions

View File

@@ -17,6 +17,14 @@ export const costanti = {
CERCO: 2,
},
ENABLE_FRIENDS: false,
ENABLE_CONTI_COMUNITARI: true,
AccountType: {
USER: 0,
COMMUNITY_ACCOUNT: 1,
},
Lang: {
IT: 1,
EN: 2,

View File

@@ -6543,6 +6543,31 @@ export const tools = {
},
getGroupsWhereIAmTheAdminOfTheCircuit(name: string, username: string) {
const userStore = useUserStore()
let arr: any[] = []
let risultato = false
if (userStore.my.profile.manage_mycircuits) {
const ris = userStore.my.profile.manage_mycircuits.find((circuit: ICircuit) => {
if (circuit.name === name) {
return true
}
})
// console.log('ris', ris)
if (ris && ris.admins) {
const isadmin = ris.admins.find((user: IFriends) => user.username === username)
risultato = !!isadmin
}
}
return arr
},
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
console.log('setcmd', cmd)
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {

View File

@@ -244,20 +244,8 @@ export const useUserStore = defineStore('UserStore', {
return false
},
GroupsListWhereIAmAdmin(username: string): string[] {
let myarr: any[] = []
const globalStore = useGlobalStore()
if (this.my.profile && globalStore.mygroups) {
myarr = globalStore.mygroups.filter((mygroup: IMyGroup) => {
if (mygroup.admins && mygroup.admins.findIndex((useradmin: IUserAdmins) => useradmin.username === username) >= 0) {
return true
}
return false
})
}
return myarr
GroupsListWhereIAmAdmin(): IMyGroup[] {
return this.my.profile.manage_mygroups
},
IsAskedFriendByUsername(username: string): boolean {