mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
apparently that was necessary
This commit is contained in:
parent
ae5bfe14e4
commit
7ee6bf379f
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ defmodule PhilomenaWeb.Api.Json.PostController do
|
|||
|> where(destroyed_content: false)
|
||||
|> where([_p, t], t.hidden_from_users == false and t.slug == ^topic_id)
|
||||
|> where([_p, _t, f], f.access_level == "normal" and f.short_name == ^forum_id)
|
||||
|> preload([:user])
|
||||
|> preload([:user, :topic])
|
||||
|> Repo.one()
|
||||
|
||||
cond do
|
||||
|
@ -40,7 +40,7 @@ defmodule PhilomenaWeb.Api.Json.PostController do
|
|||
|> where([_p, _t, f], f.access_level == "normal" and f.short_name == ^forum_id)
|
||||
|> where([p], p.topic_position >= ^(25 * (page - 1)) and p.topic_position < ^(25 * page))
|
||||
|> order_by(asc: :topic_position)
|
||||
|> preload([:user])
|
||||
|> preload([:user, :topic])
|
||||
|> preload([_p, t, _f], topic: t)
|
||||
|> Repo.all()
|
||||
|
||||
|
|
Loading…
Reference in a new issue