~mlb/linkhut

fe7bbe31bd6bbf1bfa344a9bb0312544b840457e — Matías Larre Borges 5 months ago 5c770f5
Fix for `+` in tags considered as space
1 files changed, 4 insertions(+), 4 deletions(-)

M lib/linkhut_web/controllers/link_controller.ex
M lib/linkhut_web/controllers/link_controller.ex => lib/linkhut_web/controllers/link_controller.ex +4 -4
@@ 245,7 245,7 @@ defmodule LinkhutWeb.LinkController do
  defp context(%{"username" => username, "tags" => tags, "url" => url}) do
    %Context{
      from: Accounts.get_user!(username),
      tagged_with: Enum.uniq_by(tags, &String.downcase(&1)) |> Enum.map(&URI.decode_www_form/1),
      tagged_with: Enum.uniq_by(tags, &String.downcase(&1)) |> Enum.map(&URI.decode/1),
      url: URI.decode(url)
    }
  end


@@ 253,7 253,7 @@ defmodule LinkhutWeb.LinkController do
  defp context(%{"username" => username, "tags" => tags}) do
    %Context{
      from: Accounts.get_user!(username),
      tagged_with: Enum.uniq_by(tags, &String.downcase(&1)) |> Enum.map(&URI.decode_www_form/1)
      tagged_with: Enum.uniq_by(tags, &String.downcase(&1)) |> Enum.map(&URI.decode/1)
    }
  end



@@ 266,14 266,14 @@ defmodule LinkhutWeb.LinkController do

  defp context(%{"tags" => tags, "url" => url}) do
    %Context{
      tagged_with: Enum.uniq_by(tags, &String.downcase/1) |> Enum.map(&URI.decode_www_form/1),
      tagged_with: Enum.uniq_by(tags, &String.downcase/1) |> Enum.map(&URI.decode/1),
      url: URI.decode(url)
    }
  end

  defp context(%{"tags" => tags}),
    do: %Context{
      tagged_with: Enum.uniq_by(tags, &String.downcase/1) |> Enum.map(&URI.decode_www_form/1)
      tagged_with: Enum.uniq_by(tags, &String.downcase/1) |> Enum.map(&URI.decode/1)
    }

  defp context(%{"username" => username}), do: %Context{from: Accounts.get_user!(username)}