From e172fe917a2aa3b4e68b6e13e5aeb71bf4fb0dcc Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 24 Apr 2023 14:20:36 +0200 Subject: [PATCH] fix lint --- .../ContributionForm/ContributionForm.vue | 31 ++++---- webapp/graphql/PostMutations.js | 72 +++++++++---------- 2 files changed, 50 insertions(+), 53 deletions(-) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index d84ace942..e7a8eaa36 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -45,11 +45,6 @@ formmat="DD-MM-YYYY HH:mm" style="z-index: 20" > -
@@ -71,7 +66,12 @@ - +
{{ formData.eventLocationName.length }}/{{ formSchema.eventLocationName.max }} @@ -233,7 +233,7 @@ export default { categoryIds: categories ? categories.map((category) => category.id) : [], eventStart: eventStart || null, eventEnd: eventEnd || null, - eventLocation: eventLocation || { lng: 51.0, lat: 17.0}, + eventLocation: eventLocation || { lng: 51.0, lat: 17.0 }, eventLocationName: eventLocationName || '', eventVenue: eventVenue || '', eventIsOnline: eventIsOnline || true, @@ -252,9 +252,9 @@ export default { return [] }, }, - eventStart: { required: this.creatEvent ? true : false }, - eventVenue: { required: this.creatEvent ? true : false, min: 3, max: 100 }, - eventLocationName: { required: this.creatEvent ? true : false, min: 3, max: 100 }, + eventStart: { required: !!this.creatEvent }, + eventVenue: { required: !!this.creatEvent, min: 3, max: 100 }, + eventLocationName: { required: !!this.creatEvent, min: 3, max: 100 }, }, loading: false, users: [], @@ -270,15 +270,15 @@ export default { currentUser: 'auth/user', }), eventInput() { - if ( this.creatEvent ) { + if (this.creatEvent) { return { eventStart: this.formData.eventStart, // TODO: eventEnd: this.formData.eventEnd, // TODO: eventLocationName: this.formData.eventLocationName, eventVenue: this.formData.eventVenue, // TODO: eventIsOnline: this.formData.eventIsOnline, - eventLocation: JSON.stringify(this.formData.eventLocation) - } + eventLocation: JSON.stringify(this.formData.eventLocation), + } } return undefined }, @@ -314,8 +314,7 @@ export default { } } this.loading = true - alert(JSON.stringify(this.eventInput)) - + this.$apollo .mutate({ mutation: this.contribution.id ? PostMutations().UpdatePost : PostMutations().CreatePost, @@ -331,7 +330,6 @@ export default { }, }) .then(({ data }) => { - console.log(data) this.loading = false this.$toast.success(this.$t('contribution.success')) const result = data[this.contribution.id ? 'UpdatePost' : 'CreatePost'] @@ -342,7 +340,6 @@ export default { }) }) .catch((err) => { - console.error(data) this.$toast.error(err.message) this.loading = false }) diff --git a/webapp/graphql/PostMutations.js b/webapp/graphql/PostMutations.js index 047d8cd39..01f1fb210 100644 --- a/webapp/graphql/PostMutations.js +++ b/webapp/graphql/PostMutations.js @@ -4,46 +4,46 @@ export default () => { return { CreatePost: gql` mutation ( - $id: ID - $title: String! - $slug: String - $content: String! - $categoryIds: [ID] - $groupId: ID - $postType: PostType - $eventInput: _EventInput - ) { - CreatePost( - id: $id - title: $title - slug: $slug - content: $content - categoryIds: $categoryIds - groupId: $groupId - postType: $postType - eventInput: $eventInput + $id: ID + $title: String! + $slug: String + $content: String! + $categoryIds: [ID] + $groupId: ID + $postType: PostType + $eventInput: _EventInput ) { - id - slug - title - content - disabled - deleted - postType - author { - name - } - categories { + CreatePost( + id: $id + title: $title + slug: $slug + content: $content + categoryIds: $categoryIds + groupId: $groupId + postType: $postType + eventInput: $eventInput + ) { id - } - eventStart - eventVenue - eventLocation { - lng - lat + slug + title + content + disabled + deleted + postType + author { + name + } + categories { + id + } + eventStart + eventVenue + eventLocation { + lng + lat + } } } - } `, UpdatePost: gql` mutation (