Export an event though ics
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -6,6 +6,7 @@ defmodule EventosWeb.EventController do
|
||||
|
||||
alias Eventos.Events
|
||||
alias Eventos.Events.Event
|
||||
alias Eventos.Export.ICalendar
|
||||
|
||||
action_fallback EventosWeb.FallbackController
|
||||
|
||||
@@ -28,6 +29,13 @@ defmodule EventosWeb.EventController do
|
||||
render(conn, "show.json", event: event)
|
||||
end
|
||||
|
||||
def export_to_ics(conn, %{"id" => id}) do
|
||||
event = id
|
||||
|> Events.get_event!()
|
||||
|> ICalendar.export_event()
|
||||
send_resp(conn, 200, event)
|
||||
end
|
||||
|
||||
def update(conn, %{"id" => id, "event" => event_params}) do
|
||||
event = Events.get_event!(id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user