Update stats admin endpoint
This commit is contained in:
parent
39d2f2118a
commit
cbe383ae83
6 changed files with 87 additions and 24 deletions
|
|
@ -40,7 +40,7 @@ defmodule Pleroma.CounterCache do
|
|||
end
|
||||
end
|
||||
|
||||
def get_as_map() do
|
||||
def get_sum() do
|
||||
CounterCache
|
||||
|> select([c], %{
|
||||
"public" => sum(c.public),
|
||||
|
|
@ -49,6 +49,10 @@ defmodule Pleroma.CounterCache do
|
|||
"direct" => sum(c.direct)
|
||||
})
|
||||
|> Repo.one()
|
||||
|> Enum.map(fn {visibility, dec_count} ->
|
||||
{visibility, Decimal.to_integer(dec_count)}
|
||||
end)
|
||||
|> Enum.into(%{})
|
||||
end
|
||||
|
||||
def set(instance, values) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue