mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
fix warning in conversation controller
This commit is contained in:
parent
edc2b0c5d3
commit
9cef212ed2
1 changed files with 6 additions and 8 deletions
|
@ -13,19 +13,17 @@ defmodule PhilomenaWeb.ConversationController do
|
||||||
def index(conn, %{"with" => partner}) do
|
def index(conn, %{"with" => partner}) do
|
||||||
user = conn.assigns.current_user
|
user = conn.assigns.current_user
|
||||||
|
|
||||||
conversations =
|
Conversation
|
||||||
Conversation
|
|> where([c], (c.from_id == ^user.id and c.to_id == ^partner and not c.from_hidden) or (c.to_id == ^user.id and c.from_id == ^partner and not c.to_hidden))
|
||||||
|> where([c], (c.from_id == ^user.id and c.to_id == ^partner and not c.from_hidden) or (c.to_id == ^user.id and c.from_id == ^partner and not c.to_hidden))
|
|> load_conversations(conn)
|
||||||
|> load_conversations(conn)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def index(conn, _params) do
|
def index(conn, _params) do
|
||||||
user = conn.assigns.current_user
|
user = conn.assigns.current_user
|
||||||
|
|
||||||
conversations =
|
Conversation
|
||||||
Conversation
|
|> where([c], (c.from_id == ^user.id and not c.from_hidden) or (c.to_id == ^user.id and not c.to_hidden))
|
||||||
|> where([c], (c.from_id == ^user.id and not c.from_hidden) or (c.to_id == ^user.id and not c.to_hidden))
|
|> load_conversations(conn)
|
||||||
|> load_conversations(conn)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp load_conversations(queryable, conn) do
|
defp load_conversations(queryable, conn) do
|
||||||
|
|
Loading…
Reference in a new issue