Fix bookmarks depending on embeded object and move checking if the
status is bookmarked to SQL
This commit is contained in:
parent
002ea343f8
commit
c3e9fcf098
5 changed files with 54 additions and 10 deletions
|
|
@ -41,6 +41,13 @@ defmodule Pleroma.Bookmark do
|
|||
|> preload([b, a], activity: a)
|
||||
end
|
||||
|
||||
def get(user_id, activity_id) do
|
||||
Bookmark
|
||||
|> where(user_id: ^user_id)
|
||||
|> where(activity_id: ^activity_id)
|
||||
|> Repo.one()
|
||||
end
|
||||
|
||||
@spec destroy(FlakeId.t(), FlakeId.t()) :: {:ok, Bookmark.t()} | {:error, Changeset.t()}
|
||||
def destroy(user_id, activity_id) do
|
||||
from(b in Bookmark,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue