philomena/lib/philomena_web/gallery_json.ex
2019-12-24 03:26:06 -05:00

13 lines
No EOL
334 B
Elixir

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