Add importing html and save it to Article

Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
Thelonius Kort
2022-12-29 16:43:52 +01:00
parent 60a22d011e
commit b7bd9195b6
24 changed files with 452 additions and 25 deletions

View File

@ -2,11 +2,12 @@ defmodule Outlook.Articles.Article do
use Ecto.Schema
import Ecto.Changeset
alias Outlook.Articles.InternalTree
alias Outlook.Authors.Author
alias Outlook.Translations.Translation
schema "articles" do
field :content, :string
field :content, InternalTree
field :date, :utc_datetime
field :language, :string
field :title, :string
@ -20,7 +21,7 @@ defmodule Outlook.Articles.Article do
@doc false
def changeset(article, attrs) do
article
|> cast(attrs, [:title, :content, :url, :language, :date])
|> validate_required([:title, :content, :url, :language, :date])
|> cast(attrs, [:title, :content, :url, :language, :date, :author_id])
|> validate_required([:title, :content, :url, :language, :date, :author_id])
end
end