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
d8c635b9
Commit
d8c635b9
authored
Feb 09, 2021
by
Muhammad Rafif Elfazri
Browse files
Temporary Ordering Search Filter On Threads
parent
edad1d6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/diskuy/forum_thread_page.ex
View file @
d8c635b9
...
...
@@ -21,7 +21,8 @@ defmodule Diskuy.ForumThreadPage do
def
page_search
(
title
)
do
query_start
()
|>
where
([
p
],
ilike
(
p
.
title
,
^
"%
#{
String
.
replace
(
title
,
~r/[%_(\\)]/
,
"
\\\\\\
0"
)
}
%"
))
|>
where
([
tr
],
ilike
(
tr
.
title
,
^
"%
#{
String
.
replace
(
title
,
~r/[%_(\\)]/
,
"
\\\\\\
0"
)
}
%"
))
|>
order_by
([
tr
],
asc:
tr
.
title
,
desc:
tr
.
inserted_at
)
end
def
page_per_topic
(
topic_id
)
do
...
...
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