Make sure people can't join an event with limited participants

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-11 11:50:06 +02:00
parent db5b02e397
commit bf25d22786
5 changed files with 101 additions and 3 deletions

View File

@@ -170,6 +170,9 @@ defmodule MobilizonWeb.Resolvers.Event do
|> Map.put(:actor, Person.proxify_pictures(actor)) do
{:ok, participant}
else
{:maximum_attendee_capacity, _} ->
{:error, "The event has already reached it's maximum capacity"}
{:has_event, _} ->
{:error, "Event with this ID #{inspect(event_id)} doesn't exist"}