|
|
@ -15,7 +15,7 @@ defmodule LinkShortenerWeb.Api.V1.LinkController do
|
|
|
|
with {:ok, %Link{} = link} <- Links.insert_one(link_params) do
|
|
|
|
with {:ok, %Link{} = link} <- Links.insert_one(link_params) do
|
|
|
|
conn
|
|
|
|
conn
|
|
|
|
|> put_status(:created)
|
|
|
|
|> put_status(:created)
|
|
|
|
|> put_resp_header("location", Routes.link_path(conn, :show, link))
|
|
|
|
|> put_resp_header("location", Routes.v1_link_path(conn, :show, link))
|
|
|
|
|> render("show.json", link: link)
|
|
|
|
|> render("show.json", link: link)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|