Update the controller and the view for updated Link model.
This commit is contained in:
@@ -6,11 +6,11 @@ defmodule LinkShortenerWeb.Api.V1.LinkView do
|
||||
%{data: render_many(links, LinkView, "link.json")}
|
||||
end
|
||||
|
||||
def render("show.json", %{links: link}) do
|
||||
def render("show.json", %{link: link}) do
|
||||
%{data: render_one(link, LinkView, "link.json")}
|
||||
end
|
||||
|
||||
def render("link.json", %{links: link}) do
|
||||
def render("link.json", %{link: link}) do
|
||||
%{
|
||||
id: link.id,
|
||||
name: link.name,
|
||||
|
||||
Reference in New Issue
Block a user