Update the edit function in Links to support existing links.

This commit is contained in:
2024-09-02 23:10:12 +03:00
parent 6300a1a8b7
commit d2f8543fdd
+2 -2
View File
@@ -49,9 +49,9 @@ defmodule LinkShortener.Links do
|> Repo.all()
end
def edit_one(%Link{} = link) do
def edit_one(%Link{} = link, attrs \\ %{}) do
link
|> Link.changeset(%{})
|> Link.changeset(attrs)
end
def update_one(%Link{} = link, changes) do