Refactor Autoren context into Public context

This commit is contained in:
Thelonius Kort
2023-03-01 15:24:36 +01:00
parent e8089eb24e
commit 3a2769eed1
3 changed files with 14 additions and 37 deletions

View File

@ -61,4 +61,15 @@ implement to_param protocol (no more needed for Outlook.Translations.Translation
|> String.to_integer(36)
|> get_artikel!()
end
# for /autoren/
def list_autoren do
Repo.all(Author)
end
def get_autor!(id) do
Repo.get!(Author, id)
|> Repo.preload([articles: [:translations]])
end
end