Commit 2fdbd4d1 authored by Haelwenn's avatar Haelwenn

Activity: create_activity_by_object_id_query/1 → create_by_object_ap_id/1 when is_list

parent f8ab1b74
......@@ -63,7 +63,7 @@ def by_object_ap_id(ap_id) do
)
end
def create_activity_by_object_id_query(ap_ids) do
def create_by_object_ap_id(ap_ids) when is_list(ap_ids) do
from(
activity in Activity,
where:
......@@ -82,7 +82,7 @@ def get_all_create_by_object_ap_id(ap_id) do
end
def get_create_activity_by_object_ap_id(ap_id) when is_binary(ap_id) do
create_activity_by_object_id_query([ap_id])
create_by_object_ap_id(ap_id)
|> Repo.one()
end
......
......@@ -25,7 +25,7 @@ defp get_replied_to_activities(activities) do
nil
end)
|> Enum.filter(& &1)
|> Activity.create_activity_by_object_id_query()
|> Activity.create_by_object_ap_id()
|> Repo.all()
|> Enum.reduce(%{}, fn activity, acc ->
Map.put(acc, activity.data["object"]["id"], activity)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment