tests for mastodon_api_controller.ex
This commit is contained in:
parent
130bc8e0d5
commit
ab2f21e470
7 changed files with 438 additions and 165 deletions
|
|
@ -228,4 +228,11 @@ defmodule Pleroma.Object do
|
|||
_ -> :noop
|
||||
end
|
||||
end
|
||||
|
||||
@doc "Updates data field of an object"
|
||||
def update_data(%Object{data: data} = object, attrs \\ %{}) do
|
||||
object
|
||||
|> Object.change(%{data: Map.merge(data || %{}, attrs)})
|
||||
|> Repo.update()
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue