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" });
}
}
}