- Refused User

- Report User
- Unblock User
- refresh tables when an action (setFriends and setGroups) occurred.
- fix duplicate call of loadsite
This commit is contained in:
paoloar77
2022-08-08 16:34:30 +02:00
parent ce20daed6d
commit 4cde86c113
15 changed files with 155 additions and 14 deletions

View File

@@ -4672,6 +4672,22 @@ export const tools = {
})
},
unblockUser($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
$q.dialog({
message: t('db.domanda_unblockuser', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.UNBLOCK_USER, null).then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('db.unblockedfriend'))
}
})
})
},
reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
const userStore = useUserStore()
$q.dialog({
@@ -4740,7 +4756,7 @@ export const tools = {
const userStore = useUserStore()
const notifStore = useNotifStore()
$q.dialog({
message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
message: t('db.domanda_refuse_group', { username, groupname: groupnameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
@@ -4750,7 +4766,7 @@ export const tools = {
if (res) {
notifStore.updateNotification = true
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
tools.showPositiveNotif($q, t('db.refusedgroup'))
tools.showPositiveNotif($q, t('db.refusedgroup', { username }))
}
})
})
@@ -5526,6 +5542,7 @@ export const tools = {
userStore.my.profile.list_usersgroup = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.groups = ris.listgroups ? ris.listgroups : []
userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : []
userStore.my.profile.refused_groups = ris.listRefusedGroups ? ris.listRefusedGroups : []
return [{ userId: userStore.my._id }]
}
})