[#210] Refactoring.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Tue, 4 Dec 2018 16:24:41 +0000 (19:24 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Tue, 4 Dec 2018 16:24:41 +0000 (19:24 +0300)
lib/pleroma/web/twitter_api/twitter_api_controller.ex

index a9e45f91e06514dc4f609d88d164e19f1003a106..c846dbd604ad3152145dc4d3ea7bc28af9c058ed 100644 (file)
@@ -232,9 +232,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
 
     with %Object{} = object <- Repo.get(Object, id), is_binary(description) do
       new_data = Map.put(object.data, "name", description)
-
-      change = Object.change(object, %{data: new_data})
-      {:ok, _} = Repo.update(change)
+      {:ok, _} = object |> Object.change(%{data: new_data}) |> Repo.update()
     end
 
     conn