From 8f31beb0fb0a5096e8998acb87b87483e8bfe461 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 7 Aug 2019 16:51:48 +0200 Subject: [PATCH] Make category optionnal and hide it from the form Signed-off-by: Thomas Citharel --- js/src/graphql/event.ts | 4 ++-- js/src/types/event.model.ts | 2 +- js/src/views/Event/Create.vue | 6 +++--- lib/mobilizon/events/event.ex | 1 - lib/mobilizon_web/schema/event.ex | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts index 3ec975a7..7fce45d7 100644 --- a/js/src/graphql/event.ts +++ b/js/src/graphql/event.ts @@ -141,7 +141,7 @@ export const CREATE_EVENT = gql` $title: String!, $description: String!, $organizerActorId: ID!, - $category: String!, + $category: String, $beginsOn: DateTime!, $picture: PictureInput, $tags: [String], @@ -174,7 +174,7 @@ export const EDIT_EVENT = gql` $title: String!, $description: String!, $organizerActorId: Int!, - $category: String! + $category: String ) { EditEvent(title: $title, description: $description, organizerActorId: $organizerActorId, category: $category) { uuid diff --git a/js/src/types/event.model.ts b/js/src/types/event.model.ts index 50f1eda7..841e092b 100644 --- a/js/src/types/event.model.ts +++ b/js/src/types/event.model.ts @@ -53,7 +53,7 @@ export interface IEvent { title: string; slug: string; description: string; - category: Category; + category: Category|null; beginsOn: Date; endsOn: Date; diff --git a/js/src/views/Event/Create.vue b/js/src/views/Event/Create.vue index 3e2c9483..e83a6b79 100644 --- a/js/src/views/Event/Create.vue +++ b/js/src/views/Event/Create.vue @@ -29,7 +29,7 @@ - +

@@ -103,7 +103,7 @@ export default class CreateEvent extends Vue { @Prop({ required: false, type: String }) uuid!: string; loggedPerson: IPerson = new Person(); - categories: string[] = Object.keys(Category); + /*categories: string[] = Object.keys(Category);*/ event: IEvent = new EventModel(); pictureFile: File | null = null; EventVisibility = EventVisibility; diff --git a/lib/mobilizon/events/event.ex b/lib/mobilizon/events/event.ex index fe100b3e..d3be7e20 100644 --- a/lib/mobilizon/events/event.ex +++ b/lib/mobilizon/events/event.ex @@ -91,7 +91,6 @@ defmodule Mobilizon.Events.Event do :title, :begins_on, :organizer_actor_id, - :category, :url, :uuid ]) diff --git a/lib/mobilizon_web/schema/event.ex b/lib/mobilizon_web/schema/event.ex index aff8bc83..96f8bea3 100644 --- a/lib/mobilizon_web/schema/event.ex +++ b/lib/mobilizon_web/schema/event.ex @@ -131,7 +131,7 @@ defmodule MobilizonWeb.Schema.EventType do arg(:online_address, :string) arg(:phone_address, :string) arg(:organizer_actor_id, non_null(:id)) - arg(:category, non_null(:string)) + arg(:category, :string) arg(:physical_address, :address_input) resolve(&Event.create_event/3)