X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Freport_note.ex;h=f8bab15487962cc5f7d3d46ccab6555b15ec2620;hb=0c2c057c75e21ec411599016b705801f98565cf8;hp=91102696be05c77588dd5878e78017908c9c7240;hpb=4b60d41db9d10e971ee91202389991da294c72de;p=akkoma diff --git a/lib/pleroma/report_note.ex b/lib/pleroma/report_note.ex index 91102696b..f8bab1548 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-2021 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