Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit f48013bb authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Add Ordering on API Post and Threads Model

parent 92592449
No related branches found
No related tags found
No related merge requests found
......@@ -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 """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment