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