Make sure query is reloded after asking to join a group
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a56f28f98e
commit
c1fd7d558d
|
@ -545,6 +545,7 @@ import { IMember } from "@/types/actor/member.model";
|
||||||
import RouteName from "../../router/name";
|
import RouteName from "../../router/name";
|
||||||
import GroupSection from "../../components/Group/GroupSection.vue";
|
import GroupSection from "../../components/Group/GroupSection.vue";
|
||||||
import ReportModal from "../../components/Report/ReportModal.vue";
|
import ReportModal from "../../components/Report/ReportModal.vue";
|
||||||
|
import { PERSON_MEMBERSHIP_GROUP } from "@/graphql/actor";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
apollo: {
|
apollo: {
|
||||||
|
@ -604,11 +605,24 @@ export default class Group extends mixins(GroupMixin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async joinGroup(): Promise<void> {
|
async joinGroup(): Promise<void> {
|
||||||
|
const [group, currentActorId] = [
|
||||||
|
usernameWithDomain(this.group),
|
||||||
|
this.currentActor.id,
|
||||||
|
];
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: JOIN_GROUP,
|
mutation: JOIN_GROUP,
|
||||||
variables: {
|
variables: {
|
||||||
groupId: this.group.id,
|
groupId: this.group.id,
|
||||||
},
|
},
|
||||||
|
refetchQueries: [
|
||||||
|
{
|
||||||
|
query: PERSON_MEMBERSHIP_GROUP,
|
||||||
|
variables: {
|
||||||
|
id: currentActorId,
|
||||||
|
group,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue