fix formatting

This commit is contained in:
Maksim Pechnikov 2019-09-04 21:40:53 +03:00
parent e2011a667c
commit ae506ca997

View File

@ -356,19 +356,19 @@ def update_follow_state_for_all(
%Activity{data: %{"actor" => actor, "object" => object}} = activity, %Activity{data: %{"actor" => actor, "object" => object}} = activity,
state state
) do ) do
"Follow" "Follow"
|> Activity.Queries.by_type() |> Activity.Queries.by_type()
|> Activity.Queries.by_actor(actor) |> Activity.Queries.by_actor(actor)
|> Activity.Queries.by_object_id(object) |> Activity.Queries.by_object_id(object)
|> where(fragment("data->>'state' = 'pending'")) |> where(fragment("data->>'state' = 'pending'"))
|> update(set: [data: fragment("jsonb_set(data, '{state}', ?)", ^state)]) |> update(set: [data: fragment("jsonb_set(data, '{state}', ?)", ^state)])
|> Repo.update_all([]) |> Repo.update_all([])
User.set_follow_state_cache(actor, object, state) User.set_follow_state_cache(actor, object, state)
activity = Activity.get_by_id(activity.id) activity = Activity.get_by_id(activity.id)
{:ok, activity} {:ok, activity}
end end
def update_follow_state( def update_follow_state(