Add embedded schema for Artikel
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
defmodule OutlookWeb.ArtikelController do
|
||||
use OutlookWeb, :controller
|
||||
|
||||
alias Outlook.Artikel
|
||||
alias Outlook.Public
|
||||
|
||||
def index(conn, _params) do
|
||||
artikel = Artikel.list_artikel()
|
||||
artikel = Public.list_artikel()
|
||||
render(conn, :index, artikel: artikel, page_title: "Artikel")
|
||||
end
|
||||
|
||||
def show(conn, %{"tid" => tid} = params) do
|
||||
case Artikel.get_artikel_by_tid(tid) do
|
||||
case Public.get_artikel_by_tid(tid) do
|
||||
{:ok, artikel} -> render(conn, :show, artikel: artikel, page_title: artikel.title)
|
||||
{:error, message} -> conn
|
||||
|> put_status(404)
|
||||
|
||||
Reference in New Issue
Block a user