Web.MastodonAPI.MastodonAPIController: Use variable+pipe rather than nesting function calls

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-02-18 21:28:48 +01:00
parent bfd10516c9
commit ddd57c8a0f
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 5 additions and 1 deletions

View File

@ -482,9 +482,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
end
def notifications(%{assigns: %{user: user}} = conn, params) do
exclude_types =
params["exclude_types"]
|> Notification.masto_to_ap()
params =
params
|> Map.put("exclude_types", Notification.masto_to_ap(params["exclude_types"]))
|> Map.put("exclude_types", exclude_types)
notifications = Notification.for_user(user, params)