forked from AkkomaGang/akkoma
[#210] Refactoring.
This commit is contained in:
parent
826fc446d5
commit
48e6193bf2
1 changed files with 1 additions and 3 deletions
|
@ -232,9 +232,7 @@ def update_media(%{assigns: %{user: _}} = conn, %{"media_id" => id} = data) do
|
||||||
|
|
||||||
with %Object{} = object <- Repo.get(Object, id), is_binary(description) do
|
with %Object{} = object <- Repo.get(Object, id), is_binary(description) do
|
||||||
new_data = Map.put(object.data, "name", description)
|
new_data = Map.put(object.data, "name", description)
|
||||||
|
{:ok, _} = object |> Object.change(%{data: new_data}) |> Repo.update()
|
||||||
change = Object.change(object, %{data: new_data})
|
|
||||||
{:ok, _} = Repo.update(change)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|
|
Loading…
Reference in a new issue