Fakultas Ilmu Komputer UI

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

Create View for Post Pagination

parent 4540a0fb
defmodule DiskuyWeb.PostPagesView do
use DiskuyWeb, :view
# alias DiskuyWeb.ThreadPagesView
def render("pages.json", %{page: page}) do
data: Enum.map(page.entries, fn x -> x.post end),
metadata: %{
page_number: page.page_number,
page_size: page.page_size,
total_data: page.total_entries,
total_pages: page.total_pages
Supports Markdown
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