Implement report notes destruction

This commit is contained in:
Maxim Filippov 2019-12-08 11:27:23 +03:00
commit a7f77785c2
7 changed files with 88 additions and 18 deletions

View file

@ -38,9 +38,11 @@ defmodule Pleroma.ReportNote do
|> Repo.insert()
end
def get_all_for_status(status_id) do
ReportNote
|> where(activity_id: ^status_id)
|> Repo.all()
@spec destroy(FlakeId.Ecto.CompatType.t()) ::
{:ok, ReportNote.t()} | {:error, Changeset.t()}
def destroy(id) do
from(r in ReportNote, where: r.id == ^id)
|> Repo.one()
|> Repo.delete()
end
end