X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Freport_note.ex;h=a239bd3614cfa10b78b804551e9fd56916502f48;hb=f6ddf0cc50ddb7b95e3387fd68a8ba1c9f271d2c;hp=91102696be05c77588dd5878e78017908c9c7240;hpb=4b60d41db9d10e971ee91202389991da294c72de;p=akkoma
diff --git a/lib/pleroma/report_note.ex b/lib/pleroma/report_note.ex
index 91102696b..a239bd361 100644
--- a/lib/pleroma/report_note.ex
+++ b/lib/pleroma/report_note.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReportNote do
@@ -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