Make sure query is reloded after asking to join a group

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-05-18 17:12:45 +02:00
parent a56f28f98e
commit c1fd7d558d
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -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<void> {
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,
},
},
],
});
}