philomena/lib/philomena_web/gallery_json.ex

13 lines
334 B
Elixir
Raw Normal View History

2019-12-24 09:26:01 +01:00
defmodule PhilomenaWeb.GalleryJson do
def as_json(gallery) do
%{
id: gallery.id,
title: gallery.title,
thumbnail_id: gallery.thumbnail_id,
spoiler_warning: gallery.spoiler_warning,
description: gallery.description,
user: gallery.creator.name,
user_id: gallery.creator_id
}
end
end