Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Functional Programming
Diskuy-Backend
Commits
f9f0395d
Commit
f9f0395d
authored
Feb 08, 2021
by
Muhammad Rafif Elfazri
Browse files
Create View for Post Pagination
parent
4540a0fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/diskuy_web/views/post_pages_view.ex
0 → 100644
View file @
f9f0395d
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
}
}
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment