mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 12:37:58 +01:00
12 lines
359 B
Elixir
12 lines
359 B
Elixir
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]
|
|
|
|
def show(conn, _params) do
|
|
json(conn, %{image: ImageJson.as_json(conn, conn.assigns.image)})
|
|
end
|
|
end
|