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
0134b6f6
Commit
0134b6f6
authored
Jan 08, 2021
by
Muhammad Rafif Elfazri
Browse files
Fix argument use
parent
e2e635a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
diskuy_back/lib/diskuy_web/controllers/thread_controller.ex
View file @
0134b6f6
...
...
@@ -57,7 +57,7 @@ defmodule DiskuyWeb.ThreadController do
def
delete_like
(
conn
,
%{
"id"
=>
id
})
do
current_user
=
Guardian
.
Plug
.
current_resource
(
conn
)
thread
=
Forum
.
get_thread!
(
id
)
thread_like
=
Likes
.
get_thread_like_by_refer!
(
id
,
current_user
.
id
)
thread_like
=
Likes
.
get_thread_like_by_refer!
(
current_user
.
id
,
id
)
with
{
:ok
,
%
ThreadLike
{}}
<-
Likes
.
delete_thread_like
(
thread_like
),
{
:ok
,
%
Thread
{}
=
thread
}
<-
Forum
.
update_thread
(
thread
,
%{
"points"
=>
(
thread
.
points
-
1
)})
do
...
...
diskuy_back/lib/diskuy_web/controllers/thread_like_controller.ex
View file @
0134b6f6
...
...
@@ -44,7 +44,7 @@ defmodule DiskuyWeb.ThreadLikeController do
def
check_like
(
conn
,
%{
"id"
=>
id
})
do
current_user
=
Guardian
.
Plug
.
current_resource
(
conn
)
thread_like
=
Likes
.
get_thread_like_by_refer!
(
id
,
current_user
.
id
)
thread_like
=
Likes
.
get_thread_like_by_refer!
(
current_user
.
id
,
id
)
render
(
conn
,
"show.json"
,
thread_like:
thread_like
)
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