Update the edit function in Links to support existing links.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user