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