From c1fd7d558ddb600841d0bfa8d846b589398be52f Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 18 May 2021 17:12:45 +0200 Subject: [PATCH] Make sure query is reloded after asking to join a group Signed-off-by: Thomas Citharel --- js/src/views/Group/Group.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index 03c970b8..d8c2a438 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -545,6 +545,7 @@ import { IMember } from "@/types/actor/member.model"; import RouteName from "../../router/name"; import GroupSection from "../../components/Group/GroupSection.vue"; import ReportModal from "../../components/Report/ReportModal.vue"; +import { PERSON_MEMBERSHIP_GROUP } from "@/graphql/actor"; @Component({ apollo: { @@ -604,11 +605,24 @@ export default class Group extends mixins(GroupMixin) { } async joinGroup(): Promise { + const [group, currentActorId] = [ + usernameWithDomain(this.group), + this.currentActor.id, + ]; this.$apollo.mutate({ mutation: JOIN_GROUP, variables: { groupId: this.group.id, }, + refetchQueries: [ + { + query: PERSON_MEMBERSHIP_GROUP, + variables: { + id: currentActorId, + group, + }, + }, + ], }); }