mirror of
https://github.com/plausible/analytics.git
synced 2024-11-27 17:23:00 +03:00
Search sites by their members
This commit is contained in:
parent
c4d7b5ae05
commit
e692afc20e
@ -1,6 +1,13 @@
|
||||
defmodule Plausible.SiteAdmin do
|
||||
use Plausible.Repo
|
||||
|
||||
def search_fields(_schema) do
|
||||
[
|
||||
:domain,
|
||||
members: [:name, :email]
|
||||
]
|
||||
end
|
||||
|
||||
def custom_index_query(_conn, _schema, query) do
|
||||
from(r in query, preload: [:members])
|
||||
end
|
||||
@ -18,7 +25,7 @@ defmodule Plausible.SiteAdmin do
|
||||
domain: nil,
|
||||
timezone: nil,
|
||||
public: nil,
|
||||
members: %{value: fn s -> Enum.map(s.members, & &1.email) end}
|
||||
members: %{value: fn s -> Enum.map(s.members, & &1.email) |> Enum.join(", ") end}
|
||||
]
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user