Update continue_edit() to reload Translation
Reloading is necessary to detect changes in the changeset. Otherwise simple changes like changing the value of translation.public wouldn't get noticed and not being saved to db.
This commit is contained in:
@ -187,6 +187,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
|||||||
|
|
||||||
defp continue_edit(socket, :edit, %{"continue_edit" => "true"}) do
|
defp continue_edit(socket, :edit, %{"continue_edit" => "true"}) do
|
||||||
socket
|
socket
|
||||||
|
|> assign(:translation, Translations.get_translation!(socket.assigns.translation.id))
|
||||||
end
|
end
|
||||||
defp continue_edit(socket, :new, %{"continue_edit" => "true"} = params) do
|
defp continue_edit(socket, :new, %{"continue_edit" => "true"} = params) do
|
||||||
socket |> push_patch(to: ~p(/translations/#{params["id"]}/edit))
|
socket |> push_patch(to: ~p(/translations/#{params["id"]}/edit))
|
||||||
|
|||||||
Reference in New Issue
Block a user