Fakultas Ilmu Komputer UI

Commit 5aa4c5ad authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Remove Auto Capitalization

parent 1179de49
......@@ -22,15 +22,12 @@ defmodule DiskuyWeb.TopicController do
end
def show(conn, %{"id" => id}) do
new_id = Utility.capitalize_string(id)
topic = Forum.get_topic_by_name!(new_id)
topic = Forum.get_topic_by_name!(id)
render(conn, "show.json", topic: topic)
end
def update(conn, %{"id" => id, "topic" => topic_params}) do
new_id = Utility.capitalize_string(id)
topic = Forum.get_topic_by_name!(new_id)
topic = Forum.get_topic_by_name!(id)
with {:ok, %Topic{} = topic} <- Forum.update_topic(topic, topic_params) do
render(conn, "show.json", topic: topic)
......@@ -38,8 +35,7 @@ defmodule DiskuyWeb.TopicController do
end
def delete(conn, %{"id" => id}) do
new_id = Utility.capitalize_string(id)
topic = Forum.get_topic_by_name!(new_id)
topic = Forum.get_topic_by_name!(id)
with {:ok, %Topic{}} <- Forum.delete_topic(topic) do
send_resp(conn, :no_content, "")
......
Markdown is supported
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