Fakultas Ilmu Komputer UI

Commit 92aa64fb authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Fix select query on post_page

parent b4d420b3
......@@ -18,13 +18,13 @@ defmodule Diskuy.ForumPostPage do
Post
|> join(:inner, [p], u in User, as: :users, on: p.user_id == u.id)
|> join(:left, [p], tr in Thread, as: :threads, on: p.thread_id == tr.id)
|> select([p, u], %{id: p.id, message: p.message,
|> select([p, u], %{post: %{id: p.id, message: p.message,
points: p.points,
user_id: p.user_id, thread_id: p.thread_id,
parent_id: p.parent_id,
username: u.username, inserted_at: p.inserted_at,
updated_at: p.updated_at
}
}}
)
end
end
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