Fakultas Ilmu Komputer UI

Commit 0134b6f6 authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Fix argument use

parent e2e635a5
......@@ -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
......
......@@ -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
......
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