Update the controller and the view for updated Link model.

This commit is contained in:
2023-07-31 19:01:58 +03:00
parent 9e7e052249
commit 9c273a473e
3 changed files with 10 additions and 7 deletions
@@ -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,