Fix invitations

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-10-02 16:19:15 +02:00
parent 4896036cd1
commit afb7d75307
22 changed files with 298 additions and 100 deletions

View File

@@ -14,7 +14,6 @@ import { ACCEPT_INVITATION, REJECT_INVITATION } from "@/graphql/member";
import { IMember } from "@/types/actor";
import { Component, Prop, Vue } from "vue-property-decorator";
import InvitationCard from "@/components/Group/InvitationCard.vue";
import { SnackbarProgrammatic as Snackbar } from "buefy";
@Component({
components: {
@@ -33,10 +32,13 @@ export default class Invitations extends Vue {
},
});
if (data) {
this.$emit("acceptInvitation", data.acceptInvitation);
this.$emit("accept-invitation", data.acceptInvitation);
}
} catch (error) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);
}
} catch (e) {
Snackbar.open({ message: e.message, type: "is-danger", position: "is-bottom" });
}
}
@@ -49,10 +51,13 @@ export default class Invitations extends Vue {
},
});
if (data) {
this.$emit("rejectInvitation", data.rejectInvitation);
this.$emit("reject-invitation", data.rejectInvitation);
}
} catch (error) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);
}
} catch (e) {
Snackbar.open({ message: e.message, type: "is-danger", position: "is-bottom" });
}
}
}

View File

@@ -16,8 +16,8 @@
<b-loading :active.sync="$apollo.loading"></b-loading>
<invitations
:invitations="invitations"
@acceptInvitation="acceptInvitation"
@rejectInvitation="rejectInvitation"
@accept-invitation="acceptInvitation"
@reject-invitation="rejectInvitation"
/>
<section v-if="memberships && memberships.length > 0">
<GroupMemberCard
@@ -43,7 +43,6 @@ import Invitations from "@/components/Group/Invitations.vue";
import { Paginate } from "@/types/paginate";
import { IGroup, IMember, MemberRole, usernameWithDomain } from "@/types/actor";
import { Route } from "vue-router";
import { ApolloError } from "apollo-client";
import RouteName from "../../router/name";
@Component({