Fakultas Ilmu Komputer UI

Commit f48013bb authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Add Ordering on API Post and Threads Model

parent 92592449
......@@ -116,7 +116,8 @@ defmodule Diskuy.Forum do
"""
def list_threads do
Repo.all(Thread)
query = from t in Thread, order_by: t.inserted_at
Repo.all(query)
end
@doc """
......@@ -212,7 +213,8 @@ defmodule Diskuy.Forum do
"""
def list_posts do
Repo.all(Post)
query = from p in Post, order_by: p.inserted_at
Repo.all(query)
end
@doc """
......
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