@ -21,4 +21,6 @@
Added the API to show the Links model or models.
** 0.4.1 <2023-07-29 Sat>
Add the API to create the Links model.
** 0.4.2 <2023-07-30 Sun>
Add the API to delete the Links model.
@ -23,4 +23,12 @@ defmodule LinkShortenerWeb.Api.V1.LinksController do
link = Links.get_one(id)
render(conn, "show.json", links: link)
end
def delete(conn, %{"id" => id}) do
with {:ok, %Link{}} <- Links.delete_one(link) do
send_resp(conn, :no_content, "")