You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/plausible/site/removal.ex

15 lines
324 B
Elixir

defmodule Plausible.Site.Removal do
@moduledoc """
A site deletion service stub.
"""
alias Plausible.Repo
import Ecto.Query
@spec run(String.t()) :: {:ok, map()}
def run(domain) do
result = Repo.delete_all(from(s in Plausible.Site, where: s.domain == ^domain))
{:ok, %{delete_all: result}}
end
end