mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 14:17:59 +01:00
Fix update_in for Image
This commit is contained in:
parent
cb1d2b97ff
commit
a1f98e95a1
1 changed files with 2 additions and 3 deletions
|
@ -80,8 +80,7 @@ defmodule PhilomenaWeb.ImageController do
|
|||
|> Comments.change_comment()
|
||||
|
||||
image_changeset =
|
||||
image
|
||||
|> update_in([:sources], &sources_for_edit/1)
|
||||
%{image | sources: sources_for_edit(image.sources)}
|
||||
|> Images.change_image()
|
||||
|
||||
watching = Images.subscribed?(image, conn.assigns.current_user)
|
||||
|
@ -222,5 +221,5 @@ defmodule PhilomenaWeb.ImageController do
|
|||
|
||||
defp sources_for_edit(), do: [%Source{}]
|
||||
defp sources_for_edit([]), do: sources_for_edit()
|
||||
defp source_for_edit(sources), do: sources
|
||||
defp sources_for_edit(sources), do: sources
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue