Add draft feature

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-02 17:59:07 +02:00
parent b96f3bc3ad
commit 442a011490
22 changed files with 587 additions and 66 deletions

View File

@@ -6,6 +6,7 @@ defmodule MobilizonWeb.Schema.EventType do
use Absinthe.Schema.Notation
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
import MobilizonWeb.Schema.Utils
alias Mobilizon.{Actors, Addresses}
@@ -60,6 +61,8 @@ defmodule MobilizonWeb.Schema.EventType do
field(:category, :string, description: "The event's category")
field(:draft, :boolean, description: "Whether or not the event is a draft")
field(:participant_stats, :participant_stats, resolve: &Event.stats_participants_for_event/3)
field(:participants, list_of(:participant), description: "The event's participants") do
@@ -252,8 +255,9 @@ defmodule MobilizonWeb.Schema.EventType do
arg(:category, :string, default_value: "meeting")
arg(:physical_address, :address_input)
arg(:options, :event_options_input)
arg(:draft, :boolean, default_value: false)
resolve(&Event.create_event/3)
resolve(handle_errors(&Event.create_event/3))
end
@desc "Update an event"
@@ -280,8 +284,9 @@ defmodule MobilizonWeb.Schema.EventType do
arg(:category, :string)
arg(:physical_address, :address_input)
arg(:options, :event_options_input)
arg(:draft, :boolean)
resolve(&Event.update_event/3)
resolve(handle_errors(&Event.update_event/3))
end
@desc "Delete an event"