philomena/lib/philomena_web/controllers/api/json/image_controller.ex

13 lines
359 B
Elixir
Raw Normal View History

2019-12-04 01:50:23 +01:00
defmodule PhilomenaWeb.Api.Json.ImageController do
use PhilomenaWeb, :controller
alias PhilomenaWeb.ImageJson
alias Philomena.Images.Image
plug :load_and_authorize_resource, model: Image, only: [:show], preload: [:tags, :user, :intensity]
2019-12-04 01:50:23 +01:00
def show(conn, _params) do
json(conn, %{image: ImageJson.as_json(conn, conn.assigns.image)})
end
end