Add group admin profiles

And other fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-08-27 11:53:24 +02:00
parent 8afda73214
commit 1984f71cbf
107 changed files with 3514 additions and 1146 deletions

View File

@@ -7,6 +7,7 @@ defmodule Mobilizon.Tombstone do
import Ecto.Changeset
alias Mobilizon.Actors.Actor
alias Mobilizon.Storage.Repo
require Ecto.Query
@type t :: %__MODULE__{
uri: String.t(),
@@ -42,4 +43,17 @@ defmodule Mobilizon.Tombstone do
def find_tombstone(uri) do
Repo.get_by(__MODULE__, uri: uri)
end
@spec delete_actor_tombstones(String.t() | integer()) :: {integer(), nil}
def delete_actor_tombstones(actorId) do
__MODULE__
|> Ecto.Query.where(actor_id: ^actorId)
|> Repo.delete_all()
end
def delete_uri_tombstone(uri) do
__MODULE__
|> Ecto.Query.where(uri: ^uri)
|> Repo.delete_all()
end
end