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
d9955733
Commit
d9955733
authored
Feb 08, 2021
by
Muhammad Rafif Elfazri
Browse files
Remove module pagination with paginator
parent
9e23586c
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/diskuy/pagination.ex
deleted
100755 → 0
View file @
9e23586c
defmodule
Diskuy
.
Pagination
do
@moduledoc
"""
This Pagination module works with table with default id column and and timestamps
"""
alias
Diskuy
.
Repo
def
paginate_start
(
query
)
do
Repo
.
paginate
(
query
,
cursor_fields:
[
:inserted_at
,
:id
])
end
def
paginate_before
(
query
,
cursor_before
)
do
Repo
.
paginate
(
query
,
before:
cursor_before
,
cursor_fields:
[
:inserted_at
,
:id
])
end
def
paginate_after
(
query
,
cursor_after
)
do
Repo
.
paginate
(
query
,
after
:
cursor_after
,
cursor_fields:
[
:inserted_at
,
:id
])
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