Add autoren and artikel for public viewing
This commit is contained in:
16
lib/outlook_web/controllers/autor_controller.ex
Normal file
16
lib/outlook_web/controllers/autor_controller.ex
Normal file
@ -0,0 +1,16 @@
|
||||
defmodule OutlookWeb.AutorController do
|
||||
use OutlookWeb, :controller
|
||||
|
||||
alias Outlook.Autoren
|
||||
|
||||
def index(conn, _params) do
|
||||
autoren = Autoren.list_autoren()
|
||||
render(conn, :index, autoren: autoren)
|
||||
end
|
||||
|
||||
def show(conn, %{"id" => id}) do
|
||||
autor = Autoren.get_autor!(id)
|
||||
# artikel = Autoren.list_artikel(autor)
|
||||
render(conn, :show, autor: autor)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user