Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
defmodule EventosWeb.CategoryView do
|
||||
use EventosWeb, :view
|
||||
alias EventosWeb.CategoryView
|
||||
|
||||
def render("index.json", %{categories: categories}) do
|
||||
%{data: render_many(categories, CategoryView, "category.json")}
|
||||
end
|
||||
|
||||
def render("show.json", %{category: category}) do
|
||||
%{data: render_one(category, CategoryView, "category.json")}
|
||||
end
|
||||
|
||||
def render("category.json", %{category: category}) do
|
||||
%{id: category.id,
|
||||
title: category.title,
|
||||
description: category.description,
|
||||
picture: category.picture}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user