diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-06-05 14:48:02 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-06-05 14:48:02 +0000 |
commit | 54bae06b4fa960eadb9918414f50b9ececc1faa4 (patch) | |
tree | 4baf1d3c36d8e3a1a9f2c678b2e9965de16e468d /lib/pleroma/web/controller_helper.ex | |
parent | f5cb1f3616e9cb9430038697532eb49161937dec (diff) | |
download | pleroma-54bae06b4fa960eadb9918414f50b9ececc1faa4.tar.gz |
Create Pleroma.Maps.put_if_present(map, key, value, value_fun // &{:ok, &1})
Unifies all the similar functions to one and simplify some blocks with it.
Diffstat (limited to 'lib/pleroma/web/controller_helper.ex')
-rw-r--r-- | lib/pleroma/web/controller_helper.ex | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 5a1316a5f..bf832fe94 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -99,11 +99,6 @@ defmodule Pleroma.Web.ControllerHelper do render_error(conn, :not_implemented, "Can't display this activity") end - @spec put_if_exist(map(), atom() | String.t(), any) :: map() - def put_if_exist(map, _key, nil), do: map - - def put_if_exist(map, key, value), do: Map.put(map, key, value) - @doc """ Returns true if request specifies to include embedded relationships in account objects. May only be used in selected account-related endpoints; has no effect for status- or |