Refactor adding tags to an event

Also refactor extracting tags from content, now uses Pleroma's Formatter

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-26 11:30:28 +02:00
parent 845d6ff857
commit 6d80bf43ea
23 changed files with 1543 additions and 864 deletions

View File

@@ -2,7 +2,7 @@ defmodule MobilizonWeb.Resolvers.Tag do
@moduledoc """
Handles the tag-related GraphQL calls
"""
require Logger
alias Mobilizon.Events
alias Mobilizon.Events.Event
alias Mobilizon.Events.Tag
@@ -19,6 +19,15 @@ defmodule MobilizonWeb.Resolvers.Tag do
{:ok, Mobilizon.Events.list_tags_for_event(id)}
end
@doc """
Retrieve the list of tags for an event
"""
def list_tags_for_event(%{url: url}, _args, _resolution) do
with %Event{id: event_id} <- Events.get_event_by_url(url) do
{:ok, Mobilizon.Events.list_tags_for_event(event_id)}
end
end
# @doc """
# Retrieve the list of related tags for a given tag ID
# """