mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
16 lines
341 B
Elixir
16 lines
341 B
Elixir
defmodule PhilomenaWeb.AdvertController do
|
|
use PhilomenaWeb, :controller
|
|
|
|
alias PhilomenaWeb.AdvertUpdater
|
|
alias Philomena.Adverts.Advert
|
|
|
|
plug :load_resource, model: Advert
|
|
|
|
def show(conn, _params) do
|
|
advert = conn.assigns.advert
|
|
|
|
AdvertUpdater.cast(:click, advert.id)
|
|
|
|
redirect(conn, external: advert.link)
|
|
end
|
|
end
|