Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
@ -20,8 +20,8 @@ defmodule OutlookWeb.ArticleLive.FormComponent do
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
>
|
||||
<.input field={{f, :author_id}} type="hidden" />
|
||||
<.input field={{f, :title}} type="text" label="title" />
|
||||
<.input field={{f, :content}} type="text" label="content" />
|
||||
<.input field={{f, :url}} type="text" label="url" />
|
||||
<.input field={{f, :language}} type="text" label="language" />
|
||||
<.input field={{f, :date}} type="datetime-local" label="date" />
|
||||
@ -54,6 +54,8 @@ defmodule OutlookWeb.ArticleLive.FormComponent do
|
||||
end
|
||||
|
||||
def handle_event("save", %{"article" => article_params}, socket) do
|
||||
article_params = article_params
|
||||
|> Map.put("content", socket.assigns.internal_tree)
|
||||
save_article(socket, socket.assigns.action, article_params)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user