Rename project to Mobilizon
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
24
lib/mobilizon_web/views/category_view.ex
Normal file
24
lib/mobilizon_web/views/category_view.ex
Normal file
@@ -0,0 +1,24 @@
|
||||
defmodule MobilizonWeb.CategoryView do
|
||||
@moduledoc """
|
||||
View for Categories
|
||||
"""
|
||||
use MobilizonWeb, :view
|
||||
alias MobilizonWeb.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