mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-24 08:54:08 +00:00
Improve create discussion page
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2c3eb8becc
commit
0523388560
1 changed files with 7 additions and 7 deletions
|
@ -44,7 +44,7 @@ import RouteName from "../../router/name";
|
|||
},
|
||||
metaInfo() {
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
title: this.$t("Create a discussion") as string,
|
||||
// all titles will be injected into this template
|
||||
|
@ -61,7 +61,7 @@ export default class CreateDiscussion extends Vue {
|
|||
|
||||
discussion = { title: "", text: "" };
|
||||
|
||||
async createDiscussion() {
|
||||
async createDiscussion(): Promise<void> {
|
||||
try {
|
||||
const { data } = await this.$apollo.mutate({
|
||||
mutation: CREATE_DISCUSSION,
|
||||
|
@ -71,9 +71,6 @@ export default class CreateDiscussion extends Vue {
|
|||
actorId: this.group.id,
|
||||
creatorId: this.currentActor.id,
|
||||
},
|
||||
// update: (store, { data: { createDiscussion } }) => {
|
||||
// // TODO: update group list cache
|
||||
// },
|
||||
});
|
||||
|
||||
await this.$router.push({
|
||||
|
@ -83,8 +80,11 @@ export default class CreateDiscussion extends Vue {
|
|||
slug: data.createDiscussion.slug,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue