Dismiss the follow request notification on rejection
This commit is contained in:
parent
4c4344b7b1
commit
bef34568f0
3 changed files with 22 additions and 0 deletions
|
|
@ -261,6 +261,16 @@ defmodule Pleroma.Notification do
|
|||
|> Repo.delete_all()
|
||||
end
|
||||
|
||||
def dismiss(%Pleroma.Activity{} = activity) do
|
||||
Notification
|
||||
|> where([n], n.activity_id == ^activity.id)
|
||||
|> Repo.delete_all()
|
||||
|> case do
|
||||
{_, notifications} -> {:ok, notifications}
|
||||
_ -> {:error, "Cannot dismiss notification"}
|
||||
end
|
||||
end
|
||||
|
||||
def dismiss(%{id: user_id} = _user, id) do
|
||||
notification = Repo.get(Notification, id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue