Fix returns for these Repo.update_all/2 calls

This commit is contained in:
Mark Felder 2024-08-16 23:27:35 -04:00
parent 76a28396c5
commit 7a4edc7bae

View file

@ -286,6 +286,10 @@ defmodule Pleroma.Object do
]
)
|> Repo.update_all([])
|> case do
{1, [object]} -> {:ok, object}
_ -> {:error, "Not found"}
end
end
defp poll_is_multiple?(%Object{data: %{"anyOf" => [_ | _]}}), do: true
@ -310,6 +314,10 @@ defmodule Pleroma.Object do
]
)
|> Repo.update_all([])
|> case do
{1, [object]} -> {:ok, object}
_ -> {:error, "Not found"}
end
end
@decorate cache_evict(cache: @nebulex, key: {Object, ap_id})
@ -330,6 +338,10 @@ defmodule Pleroma.Object do
]
)
|> Repo.update_all([])
|> case do
{1, [object]} -> {:ok, object}
_ -> {:error, "Not found"}
end
end
@decorate cache_evict(cache: @nebulex, key: {Object, ap_id})
@ -350,6 +362,10 @@ defmodule Pleroma.Object do
]
)
|> Repo.update_all([])
|> case do
{1, [object]} -> {:ok, object}
_ -> {:error, "Not found"}
end
end
def increase_vote_count(ap_id, name, actor) do