2018-10-11 17:37:39 +02:00
|
|
|
defmodule MobilizonWeb.BotView do
|
|
|
|
use MobilizonWeb, :view
|
|
|
|
alias MobilizonWeb.BotView
|
2018-05-30 14:27:21 +02:00
|
|
|
|
|
|
|
def render("index.json", %{bots: bots}) do
|
|
|
|
%{data: render_many(bots, BotView, "bot.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("show.json", %{bot: bot}) do
|
|
|
|
%{data: render_one(bot, BotView, "bot.json")}
|
|
|
|
end
|
|
|
|
|
|
|
|
def render("bot.json", %{bot: bot}) do
|
2018-07-27 10:45:35 +02:00
|
|
|
%{id: bot.id, source: bot.source, type: bot.type}
|
2018-05-30 14:27:21 +02:00
|
|
|
end
|
|
|
|
end
|