introduce max_id parameter in feed.atom (debug)

This commit is contained in:
Hakaba Hitoyo 2018-02-09 21:46:05 +09:00
parent 9c61f60558
commit 7124f12a94

View file

@ -17,7 +17,7 @@ def feed_redirect(conn, %{"nickname" => nickname}) do
end end
end end
def feed(conn, %{"nickname" => nickname}) do def feed(conn, %{"nickname" => nickname} = params) do
user = User.get_cached_by_nickname(nickname) user = User.get_cached_by_nickname(nickname)
query = from activity in Activity, query = from activity in Activity,
where: fragment("?->>'actor' = ?", activity.data, ^user.ap_id), where: fragment("?->>'actor' = ?", activity.data, ^user.ap_id),
@ -25,7 +25,7 @@ def feed(conn, %{"nickname" => nickname}) do
order_by: [desc: :id] order_by: [desc: :id]
activities = query activities = query
|> restrict_max(opts) |> restrict_max(params)
|> Repo.all |> Repo.all
response = user response = user